简体   繁体   English

Selenium Webdriver测试在执行一段时间后停止运行

[英]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

Solution: 解:

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.

相关问题 在使用 Java 运行一些 Selenium WebDriver 测试之前清除缓存 - Clear cache before running some Selenium WebDriver tests using Java 避免在Selenium WebDriver中浏览时停止执行 - Avoid the execution stop while browsing in Selenium WebDriver 在负载下运行Selenium WebDriver测试 - Running Selenium WebDriver tests under the load 如果Spring Scheduled执行在某个固定时间后挂起,则停止 - stop Spring Scheduled execution if it hangs after some fixed time 使用Selenium WebDriver,Selenium Grid和testNG运行并行测试 - Running Parallel Tests using Selenium WebDriver, Selenium Grid and testNG 使用 Selenium Webdriver 检测是否在一段时间后找不到元素 - Detect if element wasn't found after some time using Selenium Webdriver 使用Web界面或任何可视化工具运行Selenium WebDriver测试 - Running Selenium WebDriver tests using Web interface or any Visual tool 在Firefox上运行Selenium WebDriver测试不再适用于Ubuntu - Running Selenium WebDriver tests with Firefox no longer works on Ubuntu Jenkins- Selenium Webdriver-即使在运行所有测试后,仍可以长时间在控制台中加载一个多小时 - Jenkins- Selenium Webdriver- Keeps loading in console for a long time more than an hour even after all tests are run 在当前线程中创建WebDriver之后等待Selenium测试 - Waiting in Selenium tests after Create webdriver in current thread
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM