My code is as under:

FirefoxDriver driver = new FirefoxDriver();


//element is not found here


//i want to continue the script execution 

//but the scripts comes to 


//and shows me fail

  • Here , Logic is most important. Use java concept like If, Else, exception, Selenium methods like IsDisplayed() etc. This question is very broad and depends on implantation. – Sagar007 Dec 11 '17 at 6:30
  • Quite simple- use Assert, Verify concepts, exception handling keywords, if else condition at particular steps.. – Bharat Mane Dec 11 '17 at 16:40

To continue execution there are many ways, you can use "Verify" method and If condition. (if you are using java) fore more info click here

| improve this answer | |
  • I have tried with try catch block for continue the script execution but the scripts is not failing it is showing pass..How to make the script fail when the element is not found ... – John Dec 11 '17 at 6:40
  • @John On catch add (NoSuchElement Exception e){ S.o.p("Test failed")}; – sameer joshi Dec 19 '17 at 9:30

Many frameworks have features to do it. TestNG's softAssert, for instance.

A solution independent of frameworks is to implement one yourself. You will need an object which holds the falling assertions and has a method to throw all of them somehow.

Your test:

} catch(AssertError e) {
(More asserts here....)

assertHolder's class:

hold(AssertError e) {

throwErrors() {
   errorMsg = "";
   for(error in this.errors) {
       errorMsg += error.msg; // Or accumulate these messages as you want
   if(errorMsg != "") {
     throw(new AssertError(errorMsg);
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.