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

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -