Quality Testing

Quality is delighting customers

I have a following html structure:

<div class="message status">
<h2 class="element-invisible">Status message</h2>
Welcome message
</div>

I need to verify the presence of the text "Welcome message" using Selenium IDE. I tried //div[contains(text(), 'Welcome message')]. However "locator not found"

Views: 183

Reply to This

Replies to This Discussion

try this code

//div/h2[contains(text(), 'Welcome message')]

Hi what Neil told is also right, but you are trying to take the absolute path. And i tried with the relative path.

 

As per my knowledge, it is always better to go with the Relative path.

 

Thanks,
Santosh

Hello

Try the below one. It should work:

It should be //h2[contains(text(),'message')]

 

orelse please reply me Yes or no: my gmail id: santoshpalvai@gmail.com

Thanks,
Santosh

 

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2020   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service