![](/img/trans.png)
[英]Clear cache before running some Selenium WebDriver tests using Java
[英]Selenium webdriver tests stop running after some time of execution
我一直在嘗試在IE 11和Chrome上運行硒測試。 在這兩種情況下,測試僅在經過25次奇數測試(總共350 TC)后停止運行。
配置:Windows 10專業版/嘗試過32/64位IE驅動程序/ Selenium 3.4.0
完整的日志在這里: https : //www.scribd.com/document/356096163/Logs
我沒有收到任何錯誤,看來驅動程序只是凍結了,幾分鍾后,其余所有TC都被跳過了。
注意:我已經完成了IE驅動程序的所有必需配置。
看來您的問題不在元素中。 在我發現的日志底部(無法從您指定的站點復制粘貼日志)
org.openqa.selenium.TimeoutException
使用FluentWait.until
方法時會引發異常-因此,該方法未找到id=sortable
元素。 由於未捕獲到該異常,因此它阻止了其他測試的進行。 將其包裝到try-catch
塊中
查看日志似乎是Selenium webdriver tests stop running after some time of execution
主要原因Selenium webdriver tests stop running after some time of execution
是因為在某些時候您的腳本面臨異常,例如:
org.openqa.selenium.NoSuchElementException
這是因為,在輪詢HttpClientConnection
,檢測到Connection的釋放狀態, total保持活動狀態:0 ,因此設置為visibilityOfElementLocated(By.xpath("xpath")
的Expected Conditions拋出了:
org.openqa.selenium.TimeoutException
由於作為WebDriverWait
一部分的ExpectedConditions
失敗,因此對所需元素進行某些操作的下一步也FAILED
但具有:
org.openqa.selenium.NoSuchElementException
解決此問題的方法可能是配置http-outgoing
連接以在一定時間內keep alive
,以便Selenium可以執行其配置的操作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.