【发布时间】:2018-05-30 09:36:50
【问题描述】:
尝试在 way2automation 注册页面输入用户名和密码时收到以下错误消息:
org.openqa.selenium.remote.ProtocolHandshake createSession
信息:检测到的方言:OSS
org.openqa.selenium.ElementNotVisibleException:元素不可见
以下是我的代码:
public void SignIn() {
try {
driver.findElement(By.linkText("Signin")).click();
Thread.sleep(3000);
driver.findElement(By.xpath("//*[@id=\"load_form\"]/fieldset[6]/input")).sendKeys("ankit_21");
driver.findElement(By.xpath("//*[@id=\"load_form\"]/fieldset[7]/input")).sendKeys("automation");
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
也尝试通过
搜索元素findElement(By.name("password")).sendKeys("automation");
效果不佳。
请帮忙
【问题讨论】:
-
您需要切换到新窗口。
-
请将代码的html部分粘贴到这里
标签: java selenium automation selenium-chromedriver