java - In selenium how to continue running a script even if it is failed -


i have form filling script during execution in line (step) if test case failed directly closing browser . ex: while filling form if couldn't find element (textbox or checkbox) throws exception nosuchelements , directly closes browser using assert (testng) in script want if test case failed anywhere middle want test case continue execution in report should show test case failed

in code

string jobvalue = driver.findelement(by.xpath("//label[@for='ctl00_contentplaceholder1_radpanelbar1_i0_chkcolumns_5']")).gettext();  assert.assertequals(jobvalue, "job value ($)");  reporter.log(jobvalue+" text verification ---- passed",true); 

assert fail test case if actual value not equals expected value want alternate assert or code continues executing test case till end , @ reports should show failed if actual value not equal expected value

santhosh, need more info/code on trying.by assumption, here answer question.

use validate() methods rather assert () in test steps.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -