Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.7k points)

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.

1 Answer

0 votes
by (62.9k points)
edited by

Use this for Chrome:

Step 1: Download the Chrome driver from this link.

Step 2: Use the TestNG framework.

@BeforeClass

public void setup() throws Exception

{

System.setProperty("webdriver.chrome.driver", "D://Work-Selenium//chromedriver_win32//chromedriver.exe");

driver = new chromeDriver();

baseUrl = "http://google.com";

driver.get(baseUrl);

}

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...