Launch Chrome and Wait Until it is Closed [duplicate]

北城以北 提交于 2019-11-28 02:11:25
d_air

My answer to your to question in Launch Firefox and Wait until it is Closed is also applicable here. However you need to add the import below

import org.openqa.selenium.chrome.ChromeDriver;

and change the following code from

driver = new FirefoxDriver();

to

System.setProperty("webdriver.chrome.driver", "chromedriver.exe");
driver = new ChromeDriver();

You also need to a download a separate chrome driver file (chromedriver.exe). A link is available in the selenium website. You need to copy the file in appropriate folder.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!