6

My code is not launching browser.
Project show running for a long time, but nothing happens. I pushed print and observed that WebDriver driver = new ChromeDriver(); is not getting executed.

package seleniumautomation;

import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriver;

public class seleniumautomation {
    public static void main(String[] args) {
        System.setProperty("webdriver.chrome.driver","D:/selenium_java/chromedriver.exe");
        WebDriver driver = new ChromeDriver();
        driver.navigate().to("https://www.zaakpay.com/");
    }    
}

After some debugging, I am getting this new error: enter image description here

I added manifest_vesion, but in every run, it is generating a new file and i am again getting same error.

Pseudo Sudo
  • 1,402
  • 3
  • 16
  • 34
Saurabh Shrivastava
  • 1,394
  • 4
  • 21
  • 50

6 Answers6

1

Use following code snippet to launch chrome driver.

System.setProperty("webdriver.chrome.driver", PATH_TO_EXE_FINAL);
ChromeOptions opt = new ChromeOptions();
opt.addArguments("disable-extensions");
opt.addArguments("--start-maximized");
WebDriver driver = new ChromeDriver(opt);
Amanpreet Kaur
  • 1,074
  • 8
  • 7
0

Download jar from: http://chromedriver.storage.googleapis.com/index.html?path=2.23/

System.setProperty("webdriver.chrome.driver",
                "<Downloaded file location>");
        WebDriver driver = new ChromeDriver();
        driver.get("https://www.zaakpay.com/");

Then, it will work.

Kishore Reddy
  • 886
  • 3
  • 11
  • 19
0

To use Chrome Browser needs to System.setPropert("webdriver.chrome.driver","PATH")

The ChromeDriver is maintained / supported by the Chromium project iteslf. WebDriver works with Chrome through the chromedriver binary.

Download Link of ChromeDriver : LINK

Eddie Singh
  • 58
  • 1
  • 10
0

You need to add chromedriver.exe(can be downloaded from http://www.seleniumhq.org/download/) to your project. Along with it, you need to add following lines in your code:

System.setProperty("webdriver.chrome.driver", PATH_TO_EXE_FINAL);
capabilities= DesiredCapabilities.chrome();
capabilities.setBrowserName(DesiredCapabilities.chrome().getBrowserName());
0

I solved the issue by changing my OS windows 10 language to english. selenium methods can not execute some other languages. If in both IE, geckodriver and chrome you are having the same issue it is language problem I can asuure you

Sina Cengiz
  • 136
  • 1
  • 8
0

a log line showing the version of the chromedriver, as well as other info like IP, branch+commit, etc

Trying to check the version you installed in web driver and the version you currently use in you chrome.

ANeves
  • 6,219
  • 3
  • 39
  • 63
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 29 '21 at 10:32