How to run protractor?

匆匆过客 提交于 2019-12-12 11:13:47

问题


I'm very new to protractor. I am running this in Windows command line.

I followed the this tutorial https://github.com/angular/protractor/blob/master/docs/getting-started.md

I sucessfully run npm install -g protractor

I don't know how to run this node_modules/protractor/bin/install_selenium_standalone

If I run this straight away in command line. I am getting this error 'node_modules\protractor\bin\install_selenium_standalone' is not recognized as an internal or external command, operable program or batch file.

Help me to run this sucessfully. As well as this command ./selenium/start

I am waiting for the prompt response......


回答1:


An alternate solution to the selenium standalone server is to use the binary that protractor gives us:

$ ./node_modules/protractor/bin/webdriver-manager update

This will download the files with selenium and make a start script

$ ./node_modules/protractor/bin/webdriver-manager start

This will start the standalone server.

A great article for Protractor setup and use:

http://www.ng-newsletter.com/posts/practical-protractor.html




回答2:


Install node first and then use node ./node_modules/protractor/bin/webdriver-manager update




回答3:


I was using the webdriver-manager update command and found that it was not successfully downloading the selenium-server-standalone-2.40.0.jar.

I manually downloaded the file and put it where it should be.

You may also have to install java and put it in your PATH variable as per https://github.com/angular/protractor/issues/369

..and don't forget to re-open the node.js command prompt after changing your PATH variable.




回答4:


You can install selenium standalone using "node install_selenium_standalone", if you directly write install_selenium_standalone on the command prompt it wont run, to install it with node you will need to have node installer installed on ur system its set up is very simple you can get the MSI from nodejs office website http://nodejs.org/download/

Let me know if you are still facing this error.



来源:https://stackoverflow.com/questions/20188679/how-to-run-protractor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!