How to catch 500 server error with selenium webdriver during a test in a webpage? -
i have java code selenium webdriver test presence of element in webpage. test passed each time found elements sometime when have 500 server error message on top of webpage, test passes successfully. how can fetch server error message in test. web element of error message?
any help give thanks you
i've done check similar before in regression suite...
one thing can do, have function gets executed frequently. this:
(your tags vague, utilize pseudo-java / webdriver junit)
import static org.junit.assert.fail; public void check500() { if (ispresent(driver.findelement(by.cssselector("div#500.error")))) fail("500 page displayed! failing test, , quitting."); }
you will, of course, replace "div#500.error"
whatever element unique within 500 error page. there's going one. around.
selenium
No comments:
Post a Comment