FindElement(By.AttributeValuePair(string attribute, string value))

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

FindElement(By.AttributeValuePair(string attribute, string value))

B shah
Hi Folks,

Apologies if this question/request comes across as silly or if it has been asked before, but I need to get it off my chest none-the-less :)

It would be awesome if the "By" class had a method to search for Custom attributes/value pairs. The method would look something like By.AttributeValuePair(string attribute, string value) OR even better By.AttributeValuePairs(params string[] attributeValuePairs). 

Usage would be something like FindElement(By.AttributeValuePair("id","loginButton")) or  if there's more than one search criteria FindElement(By.AttributeValuePairs("id","loginButton","text","Login"))

This could (sort of) eliminate the presence of long magic strings from page object classes (i.e. xpath & css selectors) as well as make the search criteria more readable to an extent.

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-developers/cb14de50-138f-47bf-b285-d20c8be7325b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...