Testing Tools

Loading

Can't run Chrome with Selenium WebDriver

Selenium
Author
Rambo
Date
2016-11-30 01:38
Views
50460903

Currently, I am trying to run Chrome with Selenium Web Driver in the following code:

WebDriver driver = new ChromeDriver();

driver.get("http://www.google.com");

But when building code, Eclipse informs the following error:

/*

java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see http://code.google.com/p/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html at com.google.common.base.Preconditions.checkState(Preconditions.java:177)
 at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:105)
 at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:89)
 at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:106)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
 at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
 at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
 at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
 at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
 at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
 at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
 at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
 at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
 at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
 at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
 at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

*/

I also try to use: RemoteWebDriver class and download ChromeDriver.exe from the above two links, but unsuccessful.

Please help me. Thanks

Total 4

  • 2016-02-04 15:24

    I think its because you didnt set your system property. Try this:

    File file = new File("c:\\chromedriver.exe location on your pc")

    System.setproperty(webdriver.chrome.driver, file.getabsolutepath)

    WebDriver driver = new ChromeDriver();

    driver.get("http://www.google.com");

    note: you need to download the chromedriver.exe from the internet.


  • 2016-10-28 03:03

  • 2017-05-03 18:03

    thanks


  • 2018-08-18 23:06

    Setting up system property is required (if you did not specify ChromeDriver.exe in the Project directory). To do that just add this line: System.setProperty("webdriver.chrome.driver","/{pathto}/chromedriver); or go the project folder and copy the chromedriver.exe- go back to eclipse and refresh the project- re-run test, it should work.


Total 2,401
Number Title Author Date Votes Views
2401
Running Selenium from jMeter
lucaxel | 2021.02.14 | Votes 0 | Views 51118350
lucaxel 2021.02.14 0 51118350
2400
ZeuZ: Test automation framework for Web, Mobile, Desktop, API, and Cloud apps
(TestExpert) | 2021.02.04 | Votes 0 | Views 52265380
(TestExpert) 2021.02.04 0 52265380
2399
Testsigma: Test web, mobile apps, and APIs continuously @ DevOps speed (1)
(TestExpert) | 2021.02.04 | Votes 0 | Views 51335694
(TestExpert) 2021.02.04 0 51335694
2398
Mobile User Equipment Tester
(TestExpert) | 2021.02.04 | Votes 0 | Views 52084588
(TestExpert) 2021.02.04 0 52084588
2397
Katalon TestOps OnPremise (KTOP): TestOps Tool
VTB | 2020.03.23 | Votes 0 | Views 52477687
VTB 2020.03.23 0 52477687
2396
[Paid] Ranorex Webtestit : UI web tests with Selenium or Protractor
ItSeTsQtB | 2019.08.08 | Votes 0 | Views 51984430
ItSeTsQtB 2019.08.08 0 51984430
2395
[Paid] Zabbix : Monitor any possible performance metrics and incidents in your network
^Software^ | 2019.07.24 | Votes 0 | Views 51964676
^Software^ 2019.07.24 0 51964676
2394
[Paid] NeoLoad 7.0 : Performance Test APIs to Full Applications
IT-Tester | 2019.07.24 | Votes 0 | Views 50780583
IT-Tester 2019.07.24 0 50780583
2393
[FREE] Cucumber : behavior-driven development (BDD) tool
IT-Tester | 2019.07.22 | Votes 0 | Views 49380277
IT-Tester 2019.07.22 0 49380277
2392
[Free] HTTrack : Website Testing Tool
IT-Tester | 2019.07.22 | Votes 0 | Views 51526014
IT-Tester 2019.07.22 0 51526014
2391
Arquillian : Automated integration, functional and acceptance tests for Java
IT-Tester | 2019.07.08 | Votes 0 | Views 51057517
IT-Tester 2019.07.08 0 51057517
2390
FitNesse : Automated acceptance tests are power tools for fixing a broken requirements process
IT-Tester | 2019.07.08 | Votes 0 | Views 50667742
IT-Tester 2019.07.08 0 50667742
2389
Hiptest : Continuous Testing Management Platform
IT-Tester | 2019.06.26 | Votes 0 | Views 51158741
IT-Tester 2019.06.26 0 51158741
2388
[Free] Test Data Generation Tool : DTM Data Generator
IT-Tester | 2019.06.26 | Votes 0 | Views 50236294
IT-Tester 2019.06.26 0 50236294
2387
[Free] Assertible : API testing tool which concentrates on the automation and reliability
VTB | 2019.06.21 | Votes 0 | Views 51845363
VTB 2019.06.21 0 51845363
2386
[Free] Rest-Assured : Java Domain-specific language that makes testing REST service
VTB | 2019.06.21 | Votes 0 | Views 51386919
VTB 2019.06.21 0 51386919
2385
Postman : API Testing Tool (1)
Testersbest | 2019.06.21 | Votes 0 | Views 51426516
Testersbest 2019.06.21 0 51426516
2384
Robotium: Android UI Testing
Testersbest | 2019.06.21 | Votes 1 | Views 51778358
Testersbest 2019.06.21 1 51778358
2383
Ranorex : Automation Testing Tool for desktop, web, and mobile applications
Testersbest | 2019.06.21 | Votes 0 | Views 51018505
Testersbest 2019.06.21 0 51018505
2382
TestingWhiz : Automation Testing Tool for Software, Web, Mobile, Database, Cloud, Web Services and API testing
Testersbest | 2019.06.21 | Votes 0 | Views 51666649
Testersbest 2019.06.21 0 51666649
2381
Travis CI : Test and Deploy with Confidence
edouwens | 2018.11.19 | Votes 0 | Views 51235392
edouwens 2018.11.19 0 51235392
2380
QF- Test : automation testing tool that is meant for testing Java and Web GUI application (1)
aiitistqb | 2018.10.16 | Votes 0 | Views 52450805
aiitistqb 2018.10.16 0 52450805
2379
Wink : Time-based and action-based capture of user actions
aiitistqb | 2018.10.16 | Votes 0 | Views 52036411
aiitistqb 2018.10.16 0 52036411
2378
Crucible : a web-based application primarily targeting enterprise
aiitistqb | 2018.10.16 | Votes 0 | Views 51861145
aiitistqb 2018.10.16 0 51861145
2377
Automated Mobile Testing Tools List
aiitistqb | 2018.10.16 | Votes 0 | Views 50808055
aiitistqb 2018.10.16 0 50808055
2376
SpecFlow : software tool that computer programmers use for testing other software
aiitistqb | 2018.10.16 | Votes 0 | Views 51364412
aiitistqb 2018.10.16 0 51364412
2375
Ranorex : Test Automation Tools for Complete Awesomeness
Testersbest | 2018.10.16 | Votes 0 | Views 51910826
Testersbest 2018.10.16 0 51910826
2374
SmartBear : End-to-End Automated Testing for Mobile, Web & Desktop Apps
Testersbest | 2018.10.16 | Votes 0 | Views 50989950
Testersbest 2018.10.16 0 50989950
2373
Bugdojo : Continuous QA for your web apps
Testersbest | 2018.10.16 | Votes 0 | Views 50744710
Testersbest 2018.10.16 0 50744710
2372
TEstNg (5)
kg2031 | 2018.02.28 | Votes 0 | Views 51510280
kg2031 2018.02.28 0 51510280
2371
Locators (1)
kg2031 | 2018.02.28 | Votes 0 | Views 51928967
kg2031 2018.02.28 0 51928967
2370
Crystal Reports
nk1 | 2018.02.23 | Votes 0 | Views 50998537
nk1 2018.02.23 0 50998537
2369
Selenium Learning Tutorial (4)
Dwarika | 2017.08.28 | Votes 0 | Views 51329578
Dwarika 2017.08.28 0 51329578
2368
[Paid] Module for Binary formats
SoftLogica | 2017.08.11 | Votes 0 | Views 52119398
SoftLogica 2017.08.11 0 52119398
2367
Getting Started with Selenium IDE
VijayShinde | 2017.06.09 | Votes 0 | Views 51811147
VijayShinde 2017.06.09 0 51811147
2366
UniPi Is A Powerful Board That Can Control Your Smart Home
TLP | 2017.04.26 | Votes 0 | Views 51139419
TLP 2017.04.26 0 51139419
2365
what is diff between SVN and GITHUB
vivekjog | 2017.04.24 | Votes 0 | Views 52329402
vivekjog 2017.04.24 0 52329402
2364
Macro to remove trailing spaces (1)
Christo | 2017.03.29 | Votes 0 | Views 51024297
Christo 2017.03.29 0 51024297
2363
Comparing 2 work sheets (2)
Christo | 2017.03.29 | Votes 0 | Views 51990537
Christo 2017.03.29 0 51990537
2362
Tool to generate all combinations of test parameters. (3)
Christo | 2017.03.29 | Votes 0 | Views 51699101
Christo 2017.03.29 0 51699101
2361
Best Testing Tools of 2014 (2)
kleyzit | 2017.02.24 | Votes 0 | Views 50212075
kleyzit 2017.02.24 0 50212075
2360
JCrawler (1)
Sky Driver | 2017.01.26 | Votes 0 | Views 51369442
Sky Driver 2017.01.26 0 51369442
2359
fwptt
Sky Driver | 2017.01.26 | Votes 0 | Views 50929319
Sky Driver 2017.01.26 0 50929319
2358
AppLoader: Performance Testing for Any Application
Sky Driver | 2017.01.26 | Votes 0 | Views 50847699
Sky Driver 2017.01.26 0 50847699
2357
LoadStorm
loveelok | 2017.01.20 | Votes 0 | Views 52122011
loveelok 2017.01.20 0 52122011
2356
SiteBlaster
loveelok | 2017.01.20 | Votes 0 | Views 50518456
loveelok 2017.01.20 0 50518456
2355
Xceptance LoadTest (1)
loveelok | 2017.01.20 | Votes 0 | Views 51386234
loveelok 2017.01.20 0 51386234
2354
Test Manager (1)
loveelok | 2017.01.12 | Votes 0 | Views 51243034
loveelok 2017.01.12 0 51243034
2353
Test Environment Toolkit (1)
master15 | 2017.01.06 | Votes 0 | Views 52201008
master15 2017.01.06 0 52201008
2352
Burpsuite Pro 1.5.01 (1)
master15 | 2016.12.15 | Votes 0 | Views 50675333
master15 2016.12.15 0 50675333