Element link=Selenium - Web Browser Automation not found
Solutions
未找到Web浏览器自动化、将运行速度改为slow
Exception NoSuchElementException
Solutions
1.检查目标元素的定位器。
2.如果定位器是最新的。 尝试在找到元素之前先等待页面加载。
3.如果已经等待很长时间并且始终找不到元素,请尝试使用其他类型定位符。
Exception NoSuchWindowException
Solutions
1.检查窗口的定位器。 2.等待页面加载,然后再找到窗口。
Exception NoAlertPresentException
Solutions
1.确保会显示警报(javascript弹出窗口而不是新窗口)。
2.等待页面加载,然后再处理警报。
Exception NoSuchFrameException
Solutions
1.首先定位frame上。
2.检查网页是否有父frame(如果有父frame,应先切换到父frame);
3.在切换到目标frame之前,确保切换到默认内容(仅适用于单一frame)
4.在切换到frame之前等待页面加载。
Exception UnhandledAlertException
Solutions
1. 检查是否存在警报对话框,(javascript弹出窗口),注意处理事件。
2. 如果不存在javascript弹出窗口,但仍发生异常。确保在运行自动化案例时关闭开发工具。(因为从selenium 2.19开始,添加了“unhandledalertexception”,他们认为开发工具是一个警报)
Exception UnexpectedTagNameException
Solutions
1.找到目标元素的标签名。 2.尝试等待页面加载,然后初始化选择器。
Exception StaleElementReferenceException
Solutions
再一次查找元素. (因为网页元素以及被刷新)
Exception TimeoutException
Solutions
1.检查预期条件定位器。2.增加等待时间