Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Chrome Driver with Selenium 2

I'm trying to use Chrome Drive to execute some of my tests, which are working perfectly with Firefox, but I'm not being able to execute them, I'm already verified the requirements, which are the location of Chrome, Version 12 or higher, and things like that, but anyway still not working correctly, the way to call the driver is:

WebDriver fd = new ChromeDriver();
fd.get("url");

and then searching some elements, but nothing is working, the error message is:

Exception in thread "main" org.openqa.selenium.WebDriverException: Couldn't locate Chrome. Set webdriver.chrome.bin System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.6.0_18' Driver info: driver.version: ChromeDriver at org.openqa.selenium.chrome.ChromeBinary.getChromeBinaryLocation(ChromeBinary.java:220) at org.openqa.selenium.chrome.ChromeBinary.getCommandline(ChromeBinary.java:121) at org.openqa.selenium.chrome.ChromeBinary.prepareProcess(ChromeBinary.java:67) at org.openqa.selenium.chrome.ChromeBinary.start(ChromeBinary.java:109) at org.openqa.selenium.chrome.ChromeCommandExecutor.start(ChromeCommandExecutor.java:373) at org.openqa.selenium.chrome.ChromeDriver.startClient(ChromeDriver.java:65) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:85) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:25) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:43) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:53) at equifax.qa.test.NewTests.access.main(access.java:11)

Please if anyone can help me would be great.

like image 952
SeleniumGroopie Avatar asked Jun 16 '11 18:06

SeleniumGroopie


People also ask

How do I integrate a Chrome driver using Selenium?

Go to the terminal and type the command: sudo nano /etc/paths. Enter the password. At the bottom of the file, add the path of your ChromeDriver. Type Y to save.

What does Selenium Chrome driver do?

Selenium WebDriver uses the ChromeDriver to communicate test scripts with Google Chrome. It is used to navigate between web pages and provide input to the same.

Which version of Selenium is compatible with ChromeDriver?

ChromeDriver is only compatible with Chrome version 12.0. 712.0 or newer. If you need to test an older version of Chrome, use Selenium RC and a Selenium-backed WebDriver instance.

Where does Selenium install Chrome drivers?

Below are the steps to follow while configuring the chrome setup for Selenium. #1) Check the version of the chrome. #3) Download the chromedriver.exe file for the respective OS and copy that .exe file into your local. #4) The path of the chromedriver (C:\webdriver\chromedriver.exe) will be used in our program.


1 Answers

I was able to get this to work by launching the selenium server like this:

java -jar selenium-server-standalone-2.0rc2.jar -Dwebdriver.chrome.driver=c:\path\to\chromedriver.exe

(Running Windows 7 64bit, Chrome 12, selenium server rc2)

like image 75
trimper Avatar answered Oct 05 '22 13:10

trimper