google/EarlGrey

Add CSS selector matcher

Open

#211 opened on Aug 8, 2016

View on GitHub
 (11 comments) (2 reactions) (0 assignees)Objective-C (760 forks)batch import
Hacktoberfesttype: feature-request

Repository metrics

Stars
 (5,424 stars)
PR merge metrics
 (Avg merge 1d 1h) (8 merged PRs in 30d)

Description

Given the following input:

Matching on title or value will fail.

$x('//input[@title="Email" or @value="Email"]')
> []

Place holder matching works but it's not unique.

$x('//input[@title="Email" or @value="Email" or @placeholder="Email"]')
> [<input class=​"ic-Input" type=​"text" name=​"pseudonym_session[unique_id]​" value placeholder=​"Email">​, 
   <input class=​"ic-Input" type=​"text" name=​"pseudonym_session[unique_id_forgot]​" value placeholder=​"Email" id=​"pseudonym_session_unique_id_forgot">​]

I think we need to allow matching on arbitrary XPath selectors since there's no way to control the content of the webview.

Contributor guide