0
votes

I am using Selenium IDE GotoIf command, if my condition is true, then selenium executes the label that I specified. In my case, I would like my test to break if the condition is true, without going to a label, I would like my test script to break immediately if my condition is true, without being redirected to a label. I think that what I would need is an IF command instead of a GOIF command. I would like my test to behave like this:

IF CONDITION==TRUE
      TEST BREAK 
ELSE KEEP EXECUTING

Is there any command to make that happen? I would like the execution to keep going only in case my condition is false and I would like my test case to break if my condition is true, of course since the test case would break, the execution would stop at that point!

Also, is there a command to make a test case explicitly break in Selenium IDE? I would like to voluntarily make my test case break, is there any command for that?

1
I hate using these plug-ins in the IDE. If you truly need goto's & if's is to switch to webdriver. - DMart
To make it fail just have it assert for an element that could never exist on the page. - DMart

1 Answers

0
votes

I answered a similar question before albeith in a defrent way.

To force Selenium to end with an error message you have to actualy cause an error on purpose. Truthfully I would be using...

gotoIf / condition is false / Variableiffalse

click / Errormessage of my choice / (leave value field empty)

label / Variableiffalse / (leave value field empty)

Test continue up to the end

The failed click command will automaticaly end the test and post the target as your error message. I hope this was useful

your error message should appear as something similar to [error] Element message I put in target not found