You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide an option to control the order of locators(elements) to be returned when more than one condition is met while using OR operator in the PageYAML
#314
Selion always picks and returns only the last element locator when two locators in OR conditions are matched and available in the Page. Need an option to Pick any matching locators based on the request from the customer.
US: "//android.widget.TextView[1]| //android.widget.TextView[2] | //android.widget.TextView[3]"
In the above case when TextView[2] and TextView[3] are available in the page, Selion always find and return only android.widget.TextView[3].
The text was updated successfully, but these errors were encountered:
mvelu
changed the title
Provide an option to control the order of locators(elements) to be returned when more than one condition is met while using OR operator
Provide an option to control the order of locators(elements) to be returned when more than one condition is met while using OR operator in the PageYAML
Sep 6, 2016
I assume the API call you are making is getLocator on webelements that extend AbstractElement such as Link, Button, etc.
Two proposals:
A. public String getLocator()
Will return the full path in yaml, so in your example it will return
//android.widget.TextView[1]| //android.widget.TextView[2] | //android.widget.TextView[3]
B. Leave getLocator's behavior as is and create a new method, public String getLocators, which will return
//android.widget.TextView[1]| //android.widget.TextView[2] | //android.widget.TextView[3]
The only thing bad about option A is that we could break potential users who expect the behavior of this operation to return a true xpath. I can't remember if the | symbol is selion specific delimiter or selenium will take an xpath with | symbols in it. If its the former, then we will break users who are using getLocator and taking that string directly to use with APIs that take a true XPATH.
Selion always picks and returns only the last element locator when two locators in OR conditions are matched and available in the Page. Need an option to Pick any matching locators based on the request from the customer.
US: "//android.widget.TextView[1]| //android.widget.TextView[2] | //android.widget.TextView[3]"
In the above case when TextView[2] and TextView[3] are available in the page, Selion always find and return only android.widget.TextView[3].
The text was updated successfully, but these errors were encountered: