i want verify below text(html code) present on page // characters , etc using selenium /jav
<div class="powatag" data-endpoint="https://api-sb2.powatag.com" data-key="b3jvymlhbmnvdgvzdderyxbpojeymzq1njc4" data-sku="519" data-lang="en_gb" data-type="bag" data-style="bg-act-left" data-colorscheme="light" data-redirect=""></div>
appreciate on
i believe you're looking for:
string texttoverify = "some html"; boolean bfoundtext = driver.getpagesource.contains(texttoverify) assert.asserttrue(bfoundtext);
note, checks page source of last loaded page detailed here in javadoc. i've found take longer execute, when dealing large source codes. such, method more prone failure validating attributes , values , answer breaks software utilize when possible, xpath selector
Comments
Post a Comment