|
3#
楼主 |
发表于 2017-8-17 18:05:53
|
只看该作者
IEdriver版本:IEDriverServer_32.exe 3.5.0.0
代码:
@Parameters("brower")
@BeforeClass
public void beforeTest(String Brower)
{
if(Brower.equalsIgnoreCase("chrome"))
{
System.setProperty("webdriver.chrome.driver", "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chromedriver.exe");
driver = new ChromeDriver();
System.out.println("beforemethod-chrome");
}
else if(Brower.equalsIgnoreCase("firefox"))
{
System.setProperty("webdriver.gecko.driver", "C:\\Program Files (x86)\\Mozilla Firefox\\geckodriver.exe");
driver = new FirefoxDriver();
System.out.println("beforemethod-firefox");
}
else
{
System.setProperty("webdriver.ie.driver", "C:\\Program Files\\Internet Explorer\\IEDriverServer_32.exe");
driver = new InternetExplorerDriver();
System.out.println("beforemethod-IE");
}
}
@AfterClass
public void afterTest() {
driver.close();
System.out.println("AfterClass");
}
} |
|