1
votes

I have a VM with centOS, I try to run selenium server by following the tutorial here. When trying to start the selenium server with webdriver-manager start I get:

execvp(): No such file or directory seleniumProcess.pid: 22847

events.js:72 throw er; // Unhandled 'error' event ^ Error: spawn ENOENT at errnoException (child_process.js:980:11) at Process.ChildProcess._handle.onexit (child_process.js:771:34)

So I tried the same tutorial with my host (OSX) and running webdriver-manager start works perfectly. curl 192.168.0.10:4444 from my guest successfully returns the page.

I have two questions.

Why is that so?

Can I have my tests in my VM, the Selenium server on my host and successfully run my tests? I just started with protractor and wonder if I should go further or if it's a dead end.

1

1 Answers

1
votes

In case you are making use of Java to run your test, you can make use of this jar file to run your Selenium Standalone server

Command to run on your terminal java -jar selenium-server-standalone-2.40.0.jar

This will require you to have Java installed on your VM

Also, if you are making use of WebDriver and running single instance at a time, you won't be required to run selenium standalone server explicitly, FirefoxDriver runs directly without explicit server requirement. But if you want to run multiple test on your VM say 5 browsers at once, you will be required to create a Grid using Selenium Grid 2, which will require you to run your server using below code

Start Grid Server java -jar selenium-server-standalone-2.14.0.jar -role hub

Connect Grid node to Grid server java -jar selenium-server-standalone-2.14.0.jar -role node -hub http://localhost:4444/grid/register

On java side, you will require RemoteWebDriver to run over this grid server as below,

DesiredCapabilities capability = DesiredCapabilities.firefox();
WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capability);

Hope this helps you