Ran*_*ddy 7 selenium selenium-rc
我想阅读Alert中的消息.
示例:如果警报显示"电子邮件地址错误".怎么看?意味着我想将该消息存储在字符串中.
如何单击确定内部警报... ??
如何使用Selenium?
Ran*_*ray 12
我假设您正在使用Selenium WebDriver.
// Get a handle to the open alert, prompt or confirmation
Alert alert = driver.switchTo().alert();
// Get the text of the alert or prompt
alert.getText();
// And acknowledge the alert (equivalent to clicking "OK")
alert.accept();
Run Code Online (Sandbox Code Playgroud)
答案在这里找到.
如果您使用的是Selenium RC,请查看此网页.
归档时间: |
|
查看次数: |
19014 次 |
最近记录: |