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