Hello, Since I am too limited by the way tests are run in the View>Organize Tests panel, I was happy to find I can code my own run logic by accessing TestItems by scripting ( https://support.smar...
Run the test hold by a TestItem
dorian
8 years agoRegular Visitor
FWIW here is the code I use:
function run_test_from_testitem(testitem) {
var caption = testitem.elementToBeRun.Caption
var start = aqString.Find(caption, "KeywordTest");
var tiret = aqString.Find(caption, " - ");
if(start == -1) {
// script
// caption: "Script\combinations - run_xxxxx"
var file_name = caption.substr(7, tiret-7)
var test_name = caption.substr(tiret+3, 200)
var code = file_name + "[\"" + test_name + "\"]()"
try {
eval(file_name)
} catch(e) {
Log.Error("Error: script unit not imported: " + file_name)
throw e
}
eval(code)
} else {
// keyword test
var test_name = aqString.SubString(caption, tiret+3,200);
KeywordTests[ test_name ].Run();
}
}
Related Content
- 6 years ago
- 6 years ago