python - How to verify whether a certain word is present in the loaded page through WebDriver? -
how can verify if user sees on screen word, instance “book” or “book” ( on webpage https://www.amazon.com/gp/gw/ajax/s.html?ie=utf8&ref_=nav_logo ? script should check user sees including images (“title” , “alt”). script should return true or false. how can check whole page using assert true, assert false ? has written in python ?
get complete text of page .
webdriver driver = new firefoxdriver(); string bodytext = driver.findelement(by.tagname("body")).gettext(); //if word check "book" boolean iswordpresent = bodytext.contains("book");
maintain list of words wish verify on page , loop through list.
Comments
Post a Comment