Bug 183280 - WebDriver: Also ignore NoSuchwindow errors when waiting for navigation to complete
Summary: WebDriver: Also ignore NoSuchwindow errors when waiting for navigation to com...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebDriver (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-03-02 01:43 PST by Carlos Garcia Campos
Modified: 2018-03-05 00:32 PST (History)
3 users (show)

See Also:


Attachments
Patch (2.44 KB, patch)
2018-03-02 02:00 PST, Carlos Garcia Campos
bburg: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2018-03-02 01:43:02 PST
We currently ignore NoSuchFrame, but navigation or previous command might have closed the window too. This is causing tests imported/selenium/py/test/selenium/webdriver/common/window_switching_tests.py::testClickingOnAButtonThatClosesAnOpenWindowDoesNotCauseTheBrowserToHang and imported/selenium/py/test/selenium/webdriver/common/window_switching_tests.py::testCanCallGetWindowHandlesAfterClosingAWindow to fail

_____________________________________________________ testClickingOnAButtonThatClosesAnOpenWindowDoesNotCauseTheBrowserToHang[WebKitGTK] _____________________________________________________

driver = <selenium.webdriver.webkitgtk.webdriver.WebDriver (session="960616c6-b34c-42c3-b33c-16aa232e92c8")>, pages = <conftest.Pages object at 0x7ff192bc7850>

    def testClickingOnAButtonThatClosesAnOpenWindowDoesNotCauseTheBrowserToHang(driver, pages):
        pages.load("xhtmlTest.html")
        current = driver.current_window_handle
        handles = driver.window_handles
        driver.find_element_by_name("windowThree").click()
        WebDriverWait(driver, 3).until(EC.new_window_is_opened(handles))
        handles = driver.window_handles
        handles.remove(current)
        driver.switch_to.window(handles[0])
>       driver.find_element_by_id("close").click()

current    = 'page-3CA6BC92-CA3D-4F35-882D-90C881FA51F8'
driver     = <selenium.webdriver.webkitgtk.webdriver.WebDriver (session="960616c6-b34c-42c3-b33c-16aa232e92c8")>
handles    = ['page-AE36B12C-C5EB-400D-9107-888FFAF6F63E']
pages      = <conftest.Pages object at 0x7ff192bc7850>

WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/window_switching_tests.py:141: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webelement.py:80: in click
    self._execute(Command.CLICK_ELEMENT)
WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webelement.py:628: in _execute
    return self._parent.execute(command, params)
WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webdriver.py:312: in execute
    self.error_handler.check_response(response)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

_____________________________________________________ testClickingOnAButtonThatClosesAnOpenWindowDoesNotCauseTheBrowserToHang[WebKitGTK] _____________________________________________________

driver = <selenium.webdriver.webkitgtk.webdriver.WebDriver (session="960616c6-b34c-42c3-b33c-16aa232e92c8")>, pages = <conftest.Pages object at 0x7ff192bc7850>

    def testClickingOnAButtonThatClosesAnOpenWindowDoesNotCauseTheBrowserToHang(driver, pages):
        pages.load("xhtmlTest.html")
        current = driver.current_window_handle
        handles = driver.window_handles
        driver.find_element_by_name("windowThree").click()
        WebDriverWait(driver, 3).until(EC.new_window_is_opened(handles))
        handles = driver.window_handles
        handles.remove(current)
        driver.switch_to.window(handles[0])
>       driver.find_element_by_id("close").click()

current    = 'page-3CA6BC92-CA3D-4F35-882D-90C881FA51F8'
driver     = <selenium.webdriver.webkitgtk.webdriver.WebDriver (session="960616c6-b34c-42c3-b33c-16aa232e92c8")>
handles    = ['page-AE36B12C-C5EB-400D-9107-888FFAF6F63E']
pages      = <conftest.Pages object at 0x7ff192bc7850>

WebDriverTests/imported/selenium/py/test/selenium/webdriver/common/window_switching_tests.py:141: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webelement.py:80: in click
    self._execute(Command.CLICK_ELEMENT)
WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webelement.py:628: in _execute
    return self._parent.execute(command, params)
WebDriverTests/imported/selenium/py/selenium/webdriver/remote/webdriver.py:312: in execute
    self.error_handler.check_response(response)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7ff192bc7dd0>
response = {'status': 404, 'value': '{"value":{"error":"no such window","message":"","stacktrace":""}}'}
Comment 1 Carlos Garcia Campos 2018-03-02 02:00:16 PST
Created attachment 334887 [details]
Patch
Comment 2 BJ Burg 2018-03-02 10:45:36 PST
Comment on attachment 334887 [details]
Patch

r=me
Comment 3 Carlos Garcia Campos 2018-03-05 00:31:10 PST
Committed r229211: <https://trac.webkit.org/changeset/229211>
Comment 4 Radar WebKit Bug Importer 2018-03-05 00:32:53 PST
<rdar://problem/38132518>