I am using selenium webdriver with python. I want to use explicit wait for locating element on the basis of the links they are pointing to. For achieving this, I am using
element = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.PARTIAL_LINK_TEXT, 'dashboard')))
Here is the html code for that:
<li class="headerLink" name="dashboard"><a href="http://www.xy.com/dashboard" class="touch">Dashboard</a></li>
Everytime I run this query, I get TimeOutException
but if I use By.ID
, I am able to locate element. I tried to do the same for other websites for which link_text
worked fine.
If I use without explicit wait, I am able to find elements but with extra modification, I am getting StaleException
.
I am unable to find the solution for this. Please help me out with this. Thanks in advance.