Testing out Protractor interactively

2019-06-08 06:18发布

问题:

I am trying to run the protractor interactively to test out the elments

I start the selenium server by

wedriver-manager start

Then I go to protractor root directory

C:\Users\Name\AppData\Roaming\npm\node_modules\protractor

and type the following command

"./bin/elementexplorer.js" http://some_server/someApp

I get following errors

Script
Line : 1
Char : 1
Error : Invalid Character
Code : 800A03F6
Source : MS JScript compliation error

At line of elementexplorer.js is the following line

#!/usr/bin/env node

回答1:

I had this problem too. After you enter your protractor root directory, try entering the command

node bin\elementexplorer.js http://some_server/someApp

Make sure the node command is in your PATH environment variable so that it's recognized as a valid command. #!/usr/bin/env node is generally something you see on Unix-based systems, so in this case you need to put "node" in front to tell Windows to use Node.js.



回答2:

try leaving the quotes of the path