Sun*_*ali 5 testng selenium selenium-webdriver
相同的代码在firefox中运行,但它没有在IE9中执行并显示字符串消息"这是WebDriver服务器的初始启动页面".而其他人没有发现任何错误
public void setUp() throws Exception {
File file = new File("C:/Users/Sunil.Wali/Desktop/Softwares/IEDriverServer_Win32_2.37.0/IEDriverServer.exe");
System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
driver = new InternetExplorerDriver();
// driver = new FirefoxDriver();
baseUrl = "https://tssstrpms501.corp.trelleborg.com:12001";
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
@Test
public void testLogin() throws Exception {
driver.get(baseUrl + "/ProcessPortal/login.jsp");
driver.findElement(By.id("username")).clear();
driver.findElement(By.id("username")).sendKeys("sunil.wali");
driver.findElement(By.id("password")).clear();
driver.findElement(By.id("password")).sendKeys("Trelleborg@123");
driver.findElement(By.id("log_in")).click();
driver.findElement(By.id("processPortalUserDropdown")).click();
driver.findElement(By.id("dijit_MenuItem_56_text")).click();
}
@After
public void tearDown() throws Exception {
driver.quit();
String verificationErrorString = verificationErrors.toString();
if (!"".equals(verificationErrorString)) {
fail(verificationErrorString);
}
}
Run Code Online (Sandbox Code Playgroud)
输出: - 启动InternetExplorerDriver服务器(32位)2.37.0.0侦听端口31651
更新: 当您无权访问更改设置时,设置ignoreZoomSetting
和ignoreProtectedModeSettings
功能可以提供true
帮助.
如果您使用qaf,可以设置如下功能:
driver.name=iexplorerDriver
iexplorer.additional.capabilities={'ignoreProtectedModeSettings':true,'ignoreZoomSetting':true,'nativeEvents':false,'acceptSslCerts':true}
Run Code Online (Sandbox Code Playgroud)
小智 5
http://code.google.com/p/selenium/wiki/InternetExplorerDriver#Required_Configuration
归档时间: |
|
查看次数: |
33042 次 |
最近记录: |