Cannot find Chrome binary when executing a selenium (testng) test in jenkins on windows 7

后端 未结 13 1518
太阳男子
太阳男子 2020-12-29 10:22

I have a basic login test with selenium and testng. When executed from eclipse, it works as expected and invoke Google Chrome. If executed from TESTNG command line, it works

13条回答
  •  有刺的猬
    2020-12-29 11:01

    ChromeOptions chromeOptions= new ChromeOptions();
    chromeOptions.setBinary("C:\\Program Files (x86)\\Google\\Chrome Beta\\Application\\chrome.exe");
    System.setProperty("webdriver.chrome.driver","C:\\STUDY\\Selenium\\CHROMEDRIVERS\\chromedriver.exe");
    
    ChromeDriver driver = new ChromeDriver(chromeOptions);
    driver.get("http://newtours.demoaut.com/");
    

提交回复
热议问题