Enter Your Email Address to Watch This Lesson

Your link to unlock this lesson will be sent to this email address.

Unlock this lesson and all 832 of the free egghead.io lessons, plus get Angular 1.x content delivered directly to your inbox!



Existing egghead members will not see this. Sign in.

Just one more step!

Check your inbox for an email from us and click link to unlock your lesson.



Protractor Interactive

1:44 Angular 1.x lesson by

elementexplorer is much different now.

Have a look at elementor for you protractor element exploring needs!

Did you know that Protractor has a handy interactive mode to help with writing/debugging your end-to-end (e2e) tests?


elementexplorer is much different now.

Have a look at elementor for you protractor element exploring needs!

egghead.io comment guidelines

Avatar
egghead.io

Did you know that Protractor has a handy interactive mode to help with writing/debugging your end-to-end (e2e) tests?

Avatar
John

It looks like elementexplorer has changed significantly since this lesson was recorded. I searched for some more up-to-date help on the topic, and came across elementor instead, which is pretty good.

Avatar
Joel

It looks like elementexplorer has changed significantly since this lesson was recorded. I searched for some more up-to-date help on the topic, and came across elementor instead, which is pretty good.

Thanks John, I added a little note on the lesson.

In reply to John
Avatar
Raphi

When I try to run elementexplorer, I get

Please use "protractor [configFile] [options] --elementExplorer" for full functionality                             

 module.js:327                                                                                                       
      throw err;                                                                                                      
     ^                                                                                                               

 Error: Cannot find module '../lib/cli.js'                                                                           
     at Function.Module._resolveFilename (module.js:325:15)                                                          
     at Function.Module._load (module.js:276:25)                                                                     
     at Module.require (module.js:353:17)                                                                            
     at require (internal/module.js:12:17)                                                                           
     at Object.<anonymous>      (C:\Users\Raphi\AppData\Roaming\npm\node_modules\protractor\bin\elementexplorer.js:46:1)

at Module._compile (module.js:409:26)                                                                           
at Object.Module._extensions..js (module.js:416:10)                                                             
at Module.load (module.js:343:32)                                                                               
at Function.Module._load (module.js:300:12)                                                                     
at Function.Module.runMain (module.js:441:10)
Avatar
Paul

Hi Joel
I wasted about 10 minutes trying to debug the issue mentioned above. I'm getting the impression this lesson is 100% useless now. If that's the case, why not delete/ archive it?
Paul

In reply to Joel
Avatar
Paul

Hi Raphi If you install protractor 2.5.1, you'll find this works. Paul

In reply to Raphi

A great way to play around with protractor is to use the interactive element explorer. I have this tiny project here where if I click this button, it changes this to updated, and if I type "please," it shows this alert that says, "You know the magic word." Let's use the interactive explorer to play with this.

To open the element explorer we need to run node against the element explorer, which is found in the protractor directory. If you just either navigate to the directory, which is in local lib node modules protractor, and then just say node/bin, element explorer. I'm going to go ahead and run it against this URL here, which you can see is this one right here, and hit enter.

We are now in an interactive mode. It launched a new browser for us so we can go ahead and start getting things. If you just start hitting tab, it can show you a list of what you can do. I'm going to say element by tag name, and I'm going to see if this button can be found, and I found it. I'll go ahead and give it a name of button, and I can say button.

Let's say button.click, and run that, and you can see that it clicked the button and updated the text.

Now we can find the input so I can say element, again, element by, we'll do it by model this time, and say, I know it's named model message. It found it, so I can go ahead and assign that to input. When I say input clear, it should clear out the text. Then input send keys, and I want to send please, and hit enter. You can see it finds that alert.

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?