我是自动化测试的新手,并已开始使用 Selenium IDE 作为自动化的选择。
我只想知道是否有任何方法可以使用 IDE 处理 java 脚本警报。
假设一个场景:我点击“删除”按钮,出现一个带有确定和取消选项的 java 脚本警告框,但是 Xpath 无法识别这些元素。另一方面,当我为单击删除按钮上的事件并使用 Selenium IDE 运行它,该元素将自动删除。
所以,请大家帮忙。如果我的问题需要详细说明,请留下回复。
提前致谢。
最佳答案
看看the documentation .主要部分是这样的:
When running under Selenium, JavaScript pop-ups will not appear. This is because the function calls are actually being overridden at runtime by Selenium’s own JavaScript. However, just because you cannot see the pop-up doesn’t mean you don’t have to deal with it. To handle a pop-up, you must call its
assertFoo(pattern)
function. If you fail to assert the presence of a pop-up your next command will be blocked and you will get an error similar to the following[error] Error: There was an unexpected Confirmation! [Chose an option.]
关于javascript - Selenium IDE - 如何处理 java 脚本警报和确认,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14788118/