xpath - Selenium returns "Element text does not match" even if it does match -


i have been using selenium builder create few front end user tests , have come across issue verifytext, cannot resolve.

on checking element below string found

close added item(s)

i expected find

recently added item(s)

i confirmed x-path have passed defiantly correct using firefinder. selenium builder seems ignoring <span> tag in case. test changed string looking to

close added item(s)

and same message returned saying

elements text "close added item(s)" not match "close added item(s)".

<div id="topcartcontent" class="block-content" style="overflow: visible;">     <div class="inner-wrapper" style="">         <p class="block-subtitle">             <span class="close-btn" onclick="topcart.hidecart()">close</span>             added item(s)         </p>         <p class="cart-empty"> have no items in shopping basket. </p>     </div> </div> 

i have confirmed value in <span> tag why unable confirm value in <p> tag?

//div[1]/header/nav/div[1]/div/div[2]/div/p[1]/span <!--returns close--> //div[1]/header/nav/div[1]/div/div[2]/div/p         <!--returns close added item(s)--> 

it not easy evaluate xpath fragment of html provided . using fragment managed find 'close' using //span[@class='close-btn']. can test xpath queries using next http://www.freeformatter.com/xpath-tester.html


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -