Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using multiple locators for identifying an object #139

Open
shaktim121 opened this issue Jun 11, 2019 · 2 comments
Open

Using multiple locators for identifying an object #139

shaktim121 opened this issue Jun 11, 2019 · 2 comments
Labels
enhancement hacktoberfest Issues that could be worked during Hacktoberfest help wanted

Comments

@shaktim121
Copy link

Is your feature request related to a problem? Please describe.
The problem is while trying to identify an object with two or multiple locators
Ex: I want to check the application for a button with text: Button1 and class_name: WinButton

Describe the solution you'd like
Ex1: Click Button text:Button1 && class_name:WinButton
Ex2: Click Button text:Button1 AND class_name:WinButton

@MummanaSubramanya
Copy link

MummanaSubramanya commented Aug 12, 2019

@eeter : any update ? seems like method _get_search_criteria needs to be changed as it need to handle chain method SearchCriteria.ByAutomationId("foo").AndByText("bar"). Any idea how to implement may be I can help you in PR.

@eeter
Copy link
Contributor

eeter commented Aug 21, 2019

This would be a very useful feature. There has been some discussion around it but no one has yet looked into actually implementing it. @MummanaSubramanya if you are interested in implementing it that would be great!

As you said _get_search_criteria should be updated to handle multiple search strategies. It should able to parse the locators and then create the chained search criteria.

One of the questions I have had is what the locator syntax should be like for chained locators. I think that from a user's point of view the Ex2 by @shaktim121 is probably the clearest option:

Click Button    text:Button1 AND class_name:WinButton

With this syntax the user should have the possibility to escape the string "AND" in case the locator value itself contains it.

@rasjani rasjani added the hacktoberfest Issues that could be worked during Hacktoberfest label Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement hacktoberfest Issues that could be worked during Hacktoberfest help wanted
Projects
None yet
Development

No branches or pull requests

4 participants