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
Post a Comment