Bug 174498 - Web Automation: link and partial link queries don't work if the link contains formatting tags
Summary: Web Automation: link and partial link queries don't work if the link contains...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 174499
  Show dependency treegraph
 
Reported: 2017-07-14 02:51 PDT by Carlos Garcia Campos
Modified: 2017-07-17 00:03 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.85 KB, patch)
2017-07-14 02:54 PDT, 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 2017-07-14 02:51:14 PDT
So, for example, if we find links with text "Foo" and there's a link like <a href=""><bA>Foo</b></a> we fail with no such element error. This causes test test_Link_With_Formatting_Tags to fail.

========================================================================================== FAILURES ==========================================================================================
_________________________________________________________________________ test_Link_With_Formatting_Tags[WebKitGTK] __________________________________________________________________________

driver = <selenium.webdriver.webkitgtk.webdriver.WebDriver (session="38543e9a-0de3-40ae-9cb8-af4e20f27c58")>, pages = <conftest.Pages object at 0x7fdba75e2490>

    def test_Link_With_Formatting_Tags(driver, pages):
        pages.load("simpleTest.html")
        elem = driver.find_element(By.ID, "links")
    
>       res = elem.find_element(By.PARTIAL_LINK_TEXT, "link with formatting tags")

E       NoSuchElementException: Message:

../selenium/webdriver/remote/errorhandler.py:193: NoSuchElementException

I think we could simply use descendant-or-self::text() instead of just text() in the links xpath expressions.
Comment 1 Carlos Garcia Campos 2017-07-14 02:54:00 PDT
Created attachment 315412 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2017-07-14 08:29:10 PDT
<rdar://problem/33316682>
Comment 3 BJ Burg 2017-07-14 10:02:27 PDT
Comment on attachment 315412 [details]
Patch

r=me

This progresses safaridriver as well.
Comment 4 Carlos Garcia Campos 2017-07-17 00:03:13 PDT
Committed r219555: <http://trac.webkit.org/changeset/219555>