java - Assert that page contents are correct with no extra elements in it -


i writing automation code , asked make test case assert page contents correct , if there element (text) in page test should fail have no idea how make test fail if there element in page suggestions me?

    driver.getpagesource().contains("text looking for"); 

you can use above in assert statement , verify. test passes if text(label) found else fails.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -