I would like to offer the list/community a couple of extensions I created. I implemented two new actions: halt and skip. My use cases were: a) I have a test that performs several related tests and I know I have a ton of changes to make and I don't want to execute the entire test while I perfect my test case - why can't I just add a halt as opposed to commenting out the code I don't want to use; b) With this same test due to test data issues I know I'll have one test that will always fail until the data gets cleaned up so I want to skip it's execution and execute the rest of the test case.
They're rough around the edges but hopefully someone will find them useful and improve upon them.
Cheers,
Mel Riffe
CODE:
Selenium.prototype.doHalt = function(message) {
commandError(message);
testComplete();
currentCommandRow = inputTableRows.length;
};
Selenium.prototype.doSkip = function(numberOfSteps) {
var steps = parseInt(numberOfSteps);
if (!isNaN(steps) && steps > -1) {
currentCommandRow += min(steps, currentCommandRow + inputTableRows.length);
}
else {
commandFailure("Number of steps was not defined as a positive whole number; currently defined as: " + numberOfSteps);
}
};
function commandFailure(errorMessage) {
setRowFailed(errorMessage, FAILURE);
}
function min(lhs, rhs) {
if (lhs <= rhs) {
return lhs;
}
else {
return rhs;
}
}
_______________________________________________ Selenium-users mailing list Selenium-users@lists.public.thoughtworks.org http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users