selenium - Dynamic WebElements-Email-Id and Date in Webdriver -


i using webdriver , want handle following scenario:

driver.findelement(by.xpath('//h1[contains(text(),'@')]')) 

can tell me how can locate dynamic web elements (say, label) email id (abc@mail.com) , date (19/06/2015) using xpath or other methods available in webdriver?

i don't want use either contains or starts-with. there other way?

you need define common identifier elements class or attribute. considering have common class like:

<li class="email">xxx@ifg.com</li> <li class="email">yyy@ifg.com</li> 

you can use:

result = driver.find_elements_by_css_selector('.email') res in result:     val = res.text 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -