How should I configure the chromedriver.exe in eclipse

0 votes

I have downloaded chromedriver.exe and eclipse, I have added through add external jars but while executing it gives me error

Error: Could not find or load main class demochrome.DemoChrome

package chromeD;

public class ChromeBrow {

    public static void main(String[] args) {

        System.setProperty("webdriver.chrome.driver", "E://chromedriver.exe");
        }

}
Mar 27, 2018 in Selenium by Johnathon
• 9,070 points
3,062 views

1 answer to this question.

0 votes

Use the page factory pattern, working example:

public class Demo{
String baseUrl = "http://google.com";
String driverPath= "C:\\chromedriver.exe";

WebDriver driver;

@BeforeTest
public void beforeTest() {
    System.setProperty("webdriver.chrome.driver", driverPath);
    driver  = new ChromeDriver();
}

and in @Test write

driver.get(baseUrl);
answered Mar 27, 2018 by Atul
• 5,530 points

Related Questions In Selenium

0 votes
0 answers
+2 votes
2 answers

How can I press ENTER key with the execute_script in selenium python?

The below code containing Keys.ENTER might just ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,050 points
5,084 views
0 votes
1 answer

Where do I get the ChromeDriver.exe from? The download link isn't available

You can download the chromedriver.exe from this ...READ MORE

answered Apr 3, 2018 in Selenium by nsv999
• 5,050 points
1,354 views
0 votes
1 answer

How do i change the location where my file gets downloaded in Selenium Webdriver and firefox driver?

There are a couple of errors there. ...READ MORE

answered Apr 12, 2018 in Selenium by nsv999
• 5,050 points
1,224 views
0 votes
1 answer

I need to release the memeory allocated to Selenium chromedriver.exe while for tests

The usage of the commands is incorrect. driver.close() ...READ MORE

answered May 21, 2018 in Selenium by sniffy_god
• 760 points
524 views
+4 votes
1 answer

How can I configure Eclipse for using Selenium?

Follow the following steps to configure your ...READ MORE

answered Dec 12, 2018 in Selenium by Nabarupa
182 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,050 points
260 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
629 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
257 views