attached zip file contains required js code (working with selenium 0.6) + tests/examples.
Separate js files are attached for selenium versions > 0.6
Examples of implemented commands:
gotolabel / label
Unconditional jump
| gotolabel |
testlabel1 |
|
| .... |
.... |
|
| label |
testlabel1 |
|
gotolabel parameters:
- a label to jump to
gotoIf / label
Conditional jump
| gotoIf |
/corrrect caption/i.test( storedVars.pagetext ) |
testlabel1 |
| .... |
.... |
|
| label |
testlabel1 |
|
gotoIf parameters:
- javascript expression
- label to jump to if javascript expression evaluated as true
(obsolete) assertNoFailureOnNextAndGoto / assertNoErrorOnNextAndGoto / label
this command is dropped in extension for Selenium Core v.0.8+
Jump if following command passed
| assertNoFailureOnNextAndGoto |
testlabel1 |
|
| verifyText |
element |
correct page |
| open |
./pageneeded.html |
|
| label |
testlabel1 |
|
while/endWhile
Cycle
| store |
0 |
loop2 |
| while |
storedVars.loop2 < 2 |
|
| store |
javascript{storedVars.loop2++} |
|
| endWhile |
|
|
while parameters:
- javascript expression.
FAQ
Q: Can the flowControl extension be used in Selenium IDE?
A: according to the following thread it can: http://forums.openqa.org/thread.jspa?messageID=20977
however, I do not use S-IDE and therefore will recommend to ask guys on corresponding (S-IDE) forum
Q: I am using this extension along with 'include' extension and getting error like "'While' is not found"". What do I do?
A: add following code at the end of IncludeCommand.prototype.doInclude function. (as per http://forums.openqa.org/thread.jspa?threadID=10163
)
if( htmlTestRunner.currentTest.initialiseLabels )
Unknown macro: {
htmlTestRunner.currentTest.initialiseLabels();
}
I was not able to jump back to a label using gotoIf or gotoLabel. Would it be possible to add this feature? I need it!
Thanks,
JPT