[英]Selenium webdriver tests stop running after some time of execution
I have been trying to run selenium tests on IE 11 and Chrome. 我一直在尝试在IE 11和Chrome上运行硒测试。 In both the cases, the tests just stop running after 25 odd tests (total 350 TCs). 在这两种情况下,测试仅在经过25次奇数测试(总共350 TC)后停止运行。
Configuration: Windows 10 pro / Tried both 32/64 bit IE driver / Selenium 3.4.0 配置:Windows 10专业版/尝试过32/64位IE驱动程序/ Selenium 3.4.0
Complete logs here: https://www.scribd.com/document/356096163/Logs 完整的日志在这里: https : //www.scribd.com/document/356096163/Logs
I am getting no error, it seems like driver just freezes, and after couple of minutes all the rest of TCs get skipped. 我没有收到任何错误,看来驱动程序只是冻结了,几分钟后,其余所有TC都被跳过了。
Note: I have done all the required configurations for IE driver, that were needed. 注意:我已经完成了IE驱动程序的所有必需配置。
Looks like your problem is in absent element. 看来您的问题不在元素中。 At the bottom of the logs I found (could not copy-paste log from the site you've specified) 在我发现的日志底部(无法从您指定的站点复制粘贴日志)
org.openqa.selenium.TimeoutException org.openqa.selenium.TimeoutException
The exception is thrown when using FluentWait.until
method - so, the method didn't find element with id=sortable
. 使用FluentWait.until
方法时会引发异常-因此,该方法未找到id=sortable
元素。 The exception stops other tests from going since it's not caught. 由于未捕获到该异常,因此它阻止了其他测试的进行。 Wrap it into try-catch
block 将其包装到try-catch
块中
Looking into your logs it seems the main reason why Selenium webdriver tests stop running after some time of execution
is because at some point of time your script is facing an exception as: 查看日志似乎是Selenium webdriver tests stop running after some time of execution
主要原因Selenium webdriver tests stop running after some time of execution
是因为在某些时候您的脚本面临异常,例如:
org.openqa.selenium.NoSuchElementException
That is because, while polling the HttpClientConnection
, a status of Connection released was detected with total kept alive: 0 , hence the Expected Conditions which was set to visibilityOfElementLocated(By.xpath("xpath")
was throwing: 这是因为,在轮询HttpClientConnection
,检测到Connection的释放状态, total保持活动状态:0 ,因此设置为visibilityOfElementLocated(By.xpath("xpath")
的Expected Conditions抛出了:
org.openqa.selenium.TimeoutException
As the ExpectedConditions
which was part of the WebDriverWait
failed, so your next step with some action on the desired element also FAILED
but with: 由于作为WebDriverWait
一部分的ExpectedConditions
失败,因此对所需元素进行某些操作的下一步也FAILED
但具有:
org.openqa.selenium.NoSuchElementException
A solution to your issue may to configure the http-outgoing
connection to remain keep alive
for a certain period of time so Selenium can perform it's configured actions. 解决此问题的方法可能是配置http-outgoing
连接以在一定时间内keep alive
,以便Selenium可以执行其配置的操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.