FuckTheWorld / chromedriver

Automatically exported from code.google.com/p/chromedriver
0 stars 0 forks source link

Tests that use GoBack or GoForward can be flaky #1118

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
testSwitchesToTopFrameAfterGoingBack is flaky, especially on Android where it 
fails nearly all the time.

It seems that the GoBack command returns before the the navigation is complete 
in the browser. This causes a "no such element" exception when the test 
searches for the <p> element in the page.

======================================================================
ERROR: testSwitchesToTopFrameAfterGoingBack (__main__.ChromeDriverTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/b/build/slave/Android_ChromeDriver_Tests__dbg_/build/src/chrome/test/chromedriver/test/run_py_tests.py", line 1081, in testSwitchesToTopFrameAfterGoingBack
    p = self._driver.FindElement('tag name', 'p')
  File "/b/build/slave/Android_ChromeDriver_Tests__dbg_/build/src/chrome/test/chromedriver/test/../client/chromedriver.py", line 231, in FindElement
    Command.FIND_ELEMENT, {'using': strategy, 'value': target})
  File "/b/build/slave/Android_ChromeDriver_Tests__dbg_/build/src/chrome/test/chromedriver/test/../client/chromedriver.py", line 176, in ExecuteCommand
    response = self._ExecuteCommand(command, params)
  File "/b/build/slave/Android_ChromeDriver_Tests__dbg_/build/src/chrome/test/chromedriver/test/../client/chromedriver.py", line 171, in _ExecuteCommand
    raise _ExceptionForResponse(response)
NoSuchElement: no such element
  (Session info: chrome=43.0.2357.78)
  (Driver info: chromedriver=2.15.323203 (01e0d4c450e9b0d94249ea256b518ea4a9a41983),platform=Linux 3.2.0-55-generic x86_64)

Original issue reported on code.google.com by samu...@chromium.org on 5 Jun 2015 at 11:06

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 5 Jun 2015 at 11:13

GoogleCodeExporter commented 9 years ago
The cause was that the page navigation command (go back/forward) would trigger 
a Page.navigateToHistoryEntry event, rather than a Page.navigate event. This 
wasn't being picked up by the old NavigationTracker, but this is fixed in 
crrev.com/1165553011.

Original comment by samu...@chromium.org on 18 Jun 2015 at 7:28