tetzura
2 years agoNew Contributor
If Else condition is failed anyway
Keyword test is failing in any case when I'm using If else condition, this is the example:
So what's happening: if condition 1 in IF stat == true - then Test is green and passed.
when IF condition FALSE, then test goes to Else condition, do Else condition, BUT the test is red and failed because it cant find the object from first IF condition.
Isn't there a way to work as OR statement or SKIP the first condition if its false and not show the results as failed (even if else condition is done)???
"If (Aliases.browser.pageMyTestProject.FindElement("xpath to existed order").Exists == true){
Aliases.browser.pageMyTestProject.FindElement("xpath to existed order").Click();}
else { Aliases.browser.pageMyTestProject.FindElement("xpath to create New button ").Click(); }"