TimeOutException when use link_text with explicit wait in selenium webdriver with python -


i using selenium webdriver python. want use explicit wait locating element on basis of links pointing to. achieving this, using

element = webdriverwait(driver, 20).until(ec.presence_of_element_located((by.partial_link_text, 'dashboard'))) 

here html code that:

<li class="headerlink" name="dashboard"><a href="http://www.xy.com/dashboard" class="touch">dashboard</a></li> 

everytime run query, timeoutexception if use by.id, able locate element. tried same other websites link_text worked fine.

if use without explicit wait, able find elements modification, getting staleexception.

i unable find solution this. please me out this. in advance.

maybe not proper tag using partiallinktext ?

find element partial link text

selenium allows identify hyperlink control partial text. can quite useful when text dynamically generated. in other words, text on 1 web page might different on next visit. might able use common text shared these dynamically generated link texts identify them. // click "cancel" link

try use linktext

find element link text hyperlinks only. using link’s text direct way click link, see on page.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -