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

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -