ยง12. Element Retrieval. Step 6: If a DOMException, SyntaxError, XPathException, or other error occurs during the execution of the element location strategy, return error invalid selector. https://www.w3.org/TR/webdriver/#dfn-find We are currently handling only XPathException and only when it's an invalid expression. In the xpath case, the spec also says "If any item in result is not an element return an error with error code invalid selector.", so we should also handle TYPE_ERR (The expression could not be converted to return the specified type.). However, since the spec says "or other error", I think we can simplify this and simply throw InvalidSelector inside the catch, without checking any specific error. This is causing 14 failures in driver_element_finding_tests.py: selenium/webdriver/common/driver_element_finding_tests.py ........................FF...........F..F.......F..FFFFFFFF..........F.F................. ================================================================================== short test summary info =================================================================================== FAIL selenium/webdriver/common/driver_element_finding_tests.py::test_Finding_ASingle_Element_By_Empty_Tag_Name_Should_Throw[WebKitGTK] FAIL selenium/webdriver/common/driver_element_finding_tests.py::test_Finding_Multiple_Elements_By_Empty_Tag_Name_Should_Throw[WebKitGTK] FAIL selenium/webdriver/common/driver_element_finding_tests.py::test_Finding_Multiple_Elements_By_Empty_Class_Name_Should_Throw[WebKitGTK] FAIL selenium/webdriver/common/driver_element_finding_tests.py::test_Finding_Multiple_Elements_By_Invalid_Class_Name_Should_Throw[WebKitGTK] FAIL selenium/webdriver/common/driver_element_finding_tests.py::test_Should_Be_Able_To_Find_Element_By_XPath_With_Namespace[WebKitGTK] FAIL selenium/webdriver/common/driver_element_finding_tests.py::test_Should_Throw_InvalidSelectorException_When_XPath_Is_Syntactically_Invalid_In_Driver_Find_Element[WebKitGTK] FAIL selenium/webdriver/common/driver_element_finding_tests.py::test_Should_Throw_InvalidSelectorException_When_XPath_Is_Syntactically_Invalid_In_Driver_Find_Elements[WebKitGTK] FAIL selenium/webdriver/common/driver_element_finding_tests.py::test_Should_Throw_InvalidSelectorException_When_XPath_Is_Syntactically_Invalid_In_Element_Find_Element[WebKitGTK] FAIL selenium/webdriver/common/driver_element_finding_tests.py::test_Should_Throw_InvalidSelectorException_When_XPath_Is_Syntactically_Invalid_In_Element_Find_Elements[WebKitGTK] FAIL selenium/webdriver/common/driver_element_finding_tests.py::test_Should_Throw_InvalidSelectorException_When_XPath_Returns_Wrong_Type_In_Driver_Find_Element[WebKitGTK] FAIL selenium/webdriver/common/driver_element_finding_tests.py::test_Should_Throw_InvalidSelectorException_When_XPath_Returns_Wrong_Type_In_Driver_Find_Elements[WebKitGTK] FAIL selenium/webdriver/common/driver_element_finding_tests.py::test_Should_Throw_InvalidSelectorException_When_XPath_Returns_Wrong_Type_In_Element_Find_Element[WebKitGTK] FAIL selenium/webdriver/common/driver_element_finding_tests.py::test_Should_Throw_InvalidSelectorException_When_XPath_Returns_Wrong_Type_In_Element_Find_Elements[WebKitGTK] FAIL selenium/webdriver/common/driver_element_finding_tests.py::test_Finding_Multiple_Elements_By_Empty_Css_Selector_Should_Throw[WebKitGTK] FAIL selenium/webdriver/common/driver_element_finding_tests.py::test_Finding_Multiple_Elements_By_Invalid_Css_Selector_Should_Throw[WebKitGTK] Only one of those is a different issue.
Created attachment 315782 [details] Patch selenium/webdriver/common/driver_element_finding_tests.py ................................................F........................................ ================================================================================== short test summary info =================================================================================== FAIL selenium/webdriver/common/driver_element_finding_tests.py::test_Should_Be_Able_To_Find_Element_By_XPath_With_Namespace[WebKitGTK]
(In reply to Carlos Garcia Campos from comment #1) > Created attachment 315782 [details] > Patch > > selenium/webdriver/common/driver_element_finding_tests.py > ................................................F............................ > ............ > ============================================================================= > ===== short test summary info > ============================================================================= > ====== > FAIL > selenium/webdriver/common/driver_element_finding_tests.py:: > test_Should_Be_Able_To_Find_Element_By_XPath_With_Namespace[WebKitGTK] btw, this test is marked xfail in all the drivers, so I'll do the same marking it as raising invalid selector.
Comment on attachment 315782 [details] Patch Attachment 315782 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/4140770 New failing tests: imported/w3c/IndexedDB-private-browsing/idbfactory_open12.html
Created attachment 315788 [details] Archive of layout-test-results from ews125 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews125 Port: ios-simulator-wk2 Platform: Mac OS X 10.12.5
Comment on attachment 315782 [details] Patch r=me
<rdar://problem/33387681>
Committed r219652: <http://trac.webkit.org/changeset/219652>