<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>183280</bug_id>
          
          <creation_ts>2018-03-02 01:43:02 -0800</creation_ts>
          <short_desc>WebDriver: Also ignore NoSuchwindow errors when waiting for navigation to complete</short_desc>
          <delta_ts>2018-03-05 00:32:53 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebDriver</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Carlos Garcia Campos">cgarcia</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bburg</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1403179</commentid>
    <comment_count>0</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2018-03-02 01:43:02 -0800</bug_when>
    <thetext>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 = &lt;selenium.webdriver.webkitgtk.webdriver.WebDriver (session=&quot;960616c6-b34c-42c3-b33c-16aa232e92c8&quot;)&gt;, pages = &lt;conftest.Pages object at 0x7ff192bc7850&gt;

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

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

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 = &lt;selenium.webdriver.webkitgtk.webdriver.WebDriver (session=&quot;960616c6-b34c-42c3-b33c-16aa232e92c8&quot;)&gt;, pages = &lt;conftest.Pages object at 0x7ff192bc7850&gt;

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

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

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 = &lt;selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7ff192bc7dd0&gt;
response = {&apos;status&apos;: 404, &apos;value&apos;: &apos;{&quot;value&quot;:{&quot;error&quot;:&quot;no such window&quot;,&quot;message&quot;:&quot;&quot;,&quot;stacktrace&quot;:&quot;&quot;}}&apos;}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1403181</commentid>
    <comment_count>1</comment_count>
      <attachid>334887</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2018-03-02 02:00:16 -0800</bug_when>
    <thetext>Created attachment 334887
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1403299</commentid>
    <comment_count>2</comment_count>
      <attachid>334887</attachid>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2018-03-02 10:45:36 -0800</bug_when>
    <thetext>Comment on attachment 334887
Patch

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1403573</commentid>
    <comment_count>3</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2018-03-05 00:31:10 -0800</bug_when>
    <thetext>Committed r229211: &lt;https://trac.webkit.org/changeset/229211&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1403574</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-03-05 00:32:53 -0800</bug_when>
    <thetext>&lt;rdar://problem/38132518&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>334887</attachid>
            <date>2018-03-02 02:00:16 -0800</date>
            <delta_ts>2018-03-02 10:45:36 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>wd-click-close-window.diff</filename>
            <type>text/plain</type>
            <size>2503</size>
            <attacher name="Carlos Garcia Campos">cgarcia</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJEcml2ZXIvQ2hhbmdlTG9nIGIvU291cmNlL1dlYkRyaXZl
ci9DaGFuZ2VMb2cKaW5kZXggNmMyOWMyOThjZmMuLjM1OGMxOGJhM2E4IDEwMDY0NAotLS0gYS9T
b3VyY2UvV2ViRHJpdmVyL0NoYW5nZUxvZworKysgYi9Tb3VyY2UvV2ViRHJpdmVyL0NoYW5nZUxv
ZwpAQCAtMSwzICsxLDE4IEBACisyMDE4LTAzLTAyICBDYXJsb3MgR2FyY2lhIENhbXBvcyAgPGNn
YXJjaWFAaWdhbGlhLmNvbT4KKworICAgICAgICBXZWJEcml2ZXI6IEFsc28gaWdub3JlIE5vU3Vj
aHdpbmRvdyBlcnJvcnMgd2hlbiB3YWl0aW5nIGZvciBuYXZpZ2F0aW9uIHRvIGNvbXBsZXRlCisg
ICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xODMyODAKKwor
ICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBXZSBjdXJyZW50
bHkgaWdub3JlIE5vU3VjaEZyYW1lLCBidXQgbmF2aWdhdGlvbiBvciBwcmV2aW91cyBjb21tYW5k
IG1pZ2h0IGhhdmUgY2xvc2VkIHRoZSB3aW5kb3cgdG9vLgorCisgICAgICAgIEZpeGVzOiBpbXBv
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JhbWU6
CiAgICAgICAgICAgICAgICAgLy8gTmF2aWdhdGlvbiBkZXN0cm95ZWQgdGhlIGN1cnJlbnQgZnJh
bWUsIHN3aXRjaCB0byB0b3AgbGV2ZWwgYnJvd3NpbmcgY29udGV4dCBhbmQgaWdub3JlIHRoZSBl
cnJvci4KICAgICAgICAgICAgICAgICBzd2l0Y2hUb0Jyb3dzaW5nQ29udGV4dChzdGQ6Om51bGxv
cHQpOwotICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAg
ICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgICAgICAgY29tcGxldGlvbkhhbmRsZXIoV1RGTW92
ZShyZXN1bHQpKTsKICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9Cg==
</data>
<flag name="review"
          id="353593"
          type_id="1"
          status="+"
          setter="bburg"
    />
          </attachment>
      

    </bug>

</bugzilla>