启动不了ie
public void setUp() throws Exception {
DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
driver = new InternetExplorerDriver(ieCapabilities);
wait = new WebDriverWait(driver, 10);
}
ie点击一个链接一直点击不到
今天遇到一个问题,用firefox的话,selenium点击一个链接没有问题,但是用ie的时候,一直点击不到,也不知道什么原因,
页面如下图:
要点击:点击此处登录这个链接,用Ie浏览器死活点不到,最后只能出奇招解决了,动用action,模拟 tab + enter 才解决:
driver.get("http://192.168.15.212:14080/register/quickRegisterPage.shtml");
click(By.xpath("//div[@class='ms_register_person_topbox']"));
//点击新用户激活,把鼠标定位到这个地方,然后tab键,然后回车,搞定
action.sendKeys(Keys.TAB).perform();
action.sendKeys(Keys.ENTER).perform();