Search code examples
firefoxseleniumtestingautomated-testsweb-testing

Selenium continues after one test


I am doing a test case in selenium webdriver and i am fairly new to testing. I am just asking if I am able to continue with a test to test other functionality after an assert has already taken place. Like the example below, Thank you in advance Ex.

search.sendKeys("hello");
search.submit();
assertTrue(....);

search.sendKeys("thank you);
search.submit();
assertTrue(....);

Solution

  • If the assert statement won't fail the test will continue. If you want to test the second functionality even if the assert does fail you should split the test to two different tests.