Frage

I just make my frist steps with Selenium. I successfully set up a test (Firefox driver), running on Selenium grid on my Jenkins (using Jenkins-Selenium-Grid plugin). I also installed Chromdriver plugin and Chrome itself on the machine (Server2003 64bit) running Jenkins. Chrome is installed for all users (in C:\Program Files (x86)\Google\Chrome\Application\chrome.exe). The Problem is: as soon i try to use the Chromedriver i get

UnreachableBrowserException: Could not start a new session. Possible causes are invalid     address of the remote server or browser start-up failure.

Since the Firefox test runs fine it must be a problem with "browser start"?! So the first question is: What is the default location for chrome binary that Chromdriver assumes? Second Question: How to fix this? Is there an Einvironment Property to set? Or could i simply set PATH to chrome.exe' location.

UPDATE: i dug around a bit, ithink i ran into this or that. is the any workaround for this issues?

War es hilfreich?

Lösung

Just went through the same process myself.

Using Selenium Plugin you can set up the selenium grid.
Using Chromedriver Plugin you can have chrome driver automatically installed.
Using Selenium Axis Plugin you can create matrix jobs.

First time installation issue After installing the Chromedriver plugin it can take a few minutes to download and be ready after it is automatically installed. It can be that the slaves try and install the chromedriver before master is fully installed and so fail to lookup the download location. Restarting the slaves will cause it to try again and install the chromedriver on the slaves.

On each slave and the master you should finally end up with a $JENKINS_HOME\tools\chromedriver\chromedrive.exe which you can refer to in the Jenkins Selenium plugin configuration for Chrome[driver] binary path as tools\chromedrive\chromedriver.exe and Jenkins will prepend the slave specific $JENKINS_HOME for you. Jenkins Selenium Config

Installed Chrome to the default location which turned out to be C:\Program Files (x86)\Google\Chrome\Application\chrome.exe same as described.

At this point I could run a test job succesfully without the error you have shown.

DesiredCapabilities capability = DesiredCapabilities.chrome();
WebDriver driver = new RemoteWebDriver(new URL("http://Jenkins.ip.here:4444/wd/hub"), capability);
driver.get(siteBase.toString());
String page = driver.getPageSource();

So some other things to consider

  • having changed jenkins selenium config, did you restart selenium service, after config change it appears to stop them. Does the config have instances specified.
  • if it was an install location issue, you might be able to change the install location options in the test cases using

    ChromeOptions options = new ChromeOptions();
    options.setBinary("/path/to/other/chrome/binary");
    

Andere Tipps

You can use this as a node setup code:

java -jar selenium-server-standalone-2.19.0.jar -Dwebdriver.chrome.driver="C:\Java\chromedriver.exe" -role node -hub http://localhost:4444/grid/register -browser "browserName=internet explorer,version=8,platform=WINDOWS" -browser "browserName=chrome,version=17,platform=WINDOWS" -browser "browserName=firefox,version=9,platform=WINDOWS" -browser "browserName=opera,version=11,platform=WINDOWS"

So there is direct point to chromedriver binary and it is a chromedriver.exe not the common chrome.exe. I had similar problem and it worked for me.

Did you specify the -Dwebdriver.chrome.driver=Path/To/ChromeDriver when starting your node?

Adding this may help.

I asked the same question in selenium group:

https://groups.google.com/forum/?fromgroups#!topic/selenium-users/-3LJ3wma3RE

the solution provided there didn't work for me but probably it works for you? (set PATH for chromedriver on jenkins)

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top