[Webkit-unassigned] [Bug 174619] New: WebDriver: handle invalid selector errors

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 18 01:56:09 PDT 2017


https://bugs.webkit.org/show_bug.cgi?id=174619

            Bug ID: 174619
           Summary: WebDriver: handle invalid selector errors
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit Misc.
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: cgarcia at igalia.com
                CC: bburg at apple.com

ยง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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170718/1c020c83/attachment-0001.html>


More information about the webkit-unassigned mailing list