Recommended way to use expected conditions on a chained locator

12 views
Skip to first unread message

dr...@pdc4u.com

unread,
Feb 22, 2018, 10:06:02 PM2/22/18
to Selenium Users

I like using a combination of WebDriverWaits and Expected Conditions to find elements on a page because of varying loading times.


I have a problem using expected conditions when I need to use a series of By's and Locating strings to find an element.

driver.find_element_by_link_text("link").find_element_by_tag_name("a") is an example of the chaining.


As i understand an Expected Condition take a tuple of (By, Locator), and does not handle a list or tuples in tuples.


What is the recommended solution to use Expected Conditions with the above example?


Should i create my own function for this?

Reply all
Reply to author
Forward
0 new messages