Forum Discussion

Aivanitskiy's avatar
Aivanitskiy
New Contributor
31 days ago
Solved

Keyword testing and object not found error

I figured it out, posted solution in the comments. Live and learn :) 

Hello fellow testers, I need some advice.
I made a keyword test that would close all of notifications by clicking little "x".
I set up a While loop condition, While "CloseNotification"=visible, this works, but 
once the Xs are all clicked and gone I get the error, "The Object CloseNotification does not exist." 
How do I set up a loop that doesn't cause an error when the condition Exists, or Visible is no longer met. 
                         Thanks! 
PS. dont mind If...Then it has the same condition as the While Loop, I only added it so I could try to set up a log with Else statement. 

 

  • Ended up asking my dev to help out and managed to solve this problem, using a true or false flag variable as a loop condition, which checks if the 'CloseNotification' EXISTS instead of VISIBLE. No more errors! 

1 Reply

  • Aivanitskiy's avatar
    Aivanitskiy
    New Contributor

    Ended up asking my dev to help out and managed to solve this problem, using a true or false flag variable as a loop condition, which checks if the 'CloseNotification' EXISTS instead of VISIBLE. No more errors!