我正在測試登錄頁面。在某些時候(間歇性地讀取)加載主頁需要無限的時間。在這種情況下,下面的命令無法完成 -Webdriver - 無限頁面加載提交
driver.findElement(By.id("Login")).submit();
我知道隱式&明確等待的。 這些等待只爲findElement或DOM相關的行動,但不服從命令((參考文獻都適用:https://sqa.stackexchange.com/questions/2606/what-is-seleniums-default-timeout-for-page-loading)
調試日誌跟蹤 -
15 May 2013 16:42:08 DEBUG wire:77 - << "{"name":"submitElement","sessionId":"949f6c8f-a8fc-4e13-b4da-bf6c19c893fe","status":0,"value":""}"
15 May 2013 16:42:08 DEBUG DefaultClientConnection:152 - Connection shut down
15 May 2013 16:42:08 DEBUG ThreadSafeClientConnManager:272 - Released connection is not reusable.
15 May 2013 16:42:08 DEBUG ConnPoolByRoute:434 - Releasing connection [HttpRoute[{}->http://127.0.0.1:7055]][null]
15 May 2013 16:42:08 DEBUG ConnPoolByRoute:679 - Notifying no-one, there are no waiting threads
15 May 2013 16:42:08 DEBUG SalesForce:153 - Verify next page
15 May 2013 16:42:08 DEBUG ThreadSafeClientConnManager:221 - Get connection: HttpRoute[{}->http://127.0.0.1:7055], timeout = 120000
15 May 2013 16:42:08 DEBUG ConnPoolByRoute:350 - [HttpRoute[{}->http://127.0.0.1:7055]] total kept alive: 0, total issued: 0, total allocated: 0 out of 2000
15 May 2013 16:42:08 DEBUG ConnPoolByRoute:523 - No free connections [HttpRoute[{}->http://127.0.0.1:7055]][null]
15 May 2013 16:42:08 DEBUG ConnPoolByRoute:369 - Available capacity: 2000 out of 2000 [HttpRoute[{}->http://127.0.0.1:7055]][null]
15 May 2013 16:42:08 DEBUG ConnPoolByRoute:549 - Creating new connection [HttpRoute[{}->http://127.0.0.1:7055]]
15 May 2013 16:42:08 DEBUG DefaultClientConnectionOperator:145 - Connecting to 127.0.0.1:7055
15 May 2013 16:42:08 DEBUG RequestAddCookies:132 - CookieSpec selected: best-match
15 May 2013 16:42:08 DEBUG RequestAuthCache:75 - Auth cache not set in the context
15 May 2013 16:42:08 DEBUG DefaultHttpClient:643 - Attempt 1 to execute request
15 May 2013 16:42:08 DEBUG DefaultClientConnection:264 - Sending request: GET /hub/session/949f6c8f-a8fc-4e13-b4da-bf6c19c893fe/title HTTP/1.1
15 May 2013 16:42:08 DEBUG wire:63 - >> "GET /hub/session/949f6c8f-a8fc-4e13-b4da-bf6c19c893fe/title HTTP/1.1[\r][\n]"
15 May 2013 16:42:08 DEBUG wire:63 - >> "Accept: application/json, image/png[\r][\n]"
15 May 2013 16:42:08 DEBUG wire:63 - >> "Cache-Control: no-cache[\r][\n]"
15 May 2013 16:42:08 DEBUG wire:63 - >> "Host: 127.0.0.1:7055[\r][\n]"
15 May 2013 16:42:08 DEBUG wire:63 - >> "Connection: Keep-Alive[\r][\n]"
15 May 2013 16:42:08 DEBUG wire:63 - >> "[\r][\n]"
15 May 2013 16:42:08 DEBUG headers:268 - >> GET /hub/session/949f6c8f-a8fc-4e13-b4da-bf6c19c893fe/title HTTP/1.1
15 May 2013 16:42:08 DEBUG headers:271 - >> Accept: application/json, image/png
15 May 2013 16:42:08 DEBUG headers:271 - >> Cache-Control: no-cache
15 May 2013 16:42:08 DEBUG headers:271 - >> Host: 127.0.0.1:7055
15 May 2013 16:42:08 DEBUG headers:271 - >> Connection: Keep-Alive
基本上DefaultClientConnection沒有收到200 OK &的命令只是掛起
尋找解決方案關閉瀏覽器以防瀏覽器沒有響應提交命令等待之後g一段特定的時間。
你的意思是像driver.close()? –
什麼。我只想在特定的等待之後進入下一個陳述情況 – praneel