Forum Discussion
kenny_trytek
14 years agoOccasional Contributor
I want a test harness like this:
function runTest(testName)
{
var test = KeywordTests[testName];
Pretest_Cleanup.discardChanges();
var docReady = Pretest_Cleanup.waitDocumentReady(30000);
if(docReady)
{
Pretest_Cleanup.removeAllSectionsManually();
Pretest_Cleanup.addNewSection();
try
{
test.Run();
}
catch(exception)
{
KeywordTest.handleException(exception);
}
}
KeywordTest.endKeywordTest(test, docReady);
KeywordTest.logTestResult(test);
}
"test" is a keyword test obtained from the KeywordTests object. KeywordTest is a class that has functions useful for manipulating keyword test results and the test itself.
An example of an error I would want to catch and handle would be this:
"Unable to activate the disabled control."
Sys.Process("IEXPLORE").Page("https://wf-quality-staging-hrd.appspot.com/editor").Panel("flashContainerDiv").Object("WebFilings").WFDialog("File Manager").Button("btnOpen")
I want to handle all errors manually, but the above script block does not catch errors related to object manipulation like the example. I tried wrapping the entire keyword test in a try...catch block, and that was what brought about the question of retrieving the error message in the first place. Here's a screenshot: http://screencast.com/t/a0SrRDyccPD
function runTest(testName)
{
var test = KeywordTests[testName];
Pretest_Cleanup.discardChanges();
var docReady = Pretest_Cleanup.waitDocumentReady(30000);
if(docReady)
{
Pretest_Cleanup.removeAllSectionsManually();
Pretest_Cleanup.addNewSection();
try
{
test.Run();
}
catch(exception)
{
KeywordTest.handleException(exception);
}
}
KeywordTest.endKeywordTest(test, docReady);
KeywordTest.logTestResult(test);
}
"test" is a keyword test obtained from the KeywordTests object. KeywordTest is a class that has functions useful for manipulating keyword test results and the test itself.
An example of an error I would want to catch and handle would be this:
"Unable to activate the disabled control."
Sys.Process("IEXPLORE").Page("https://wf-quality-staging-hrd.appspot.com/editor").Panel("flashContainerDiv").Object("WebFilings").WFDialog("File Manager").Button("btnOpen")
I want to handle all errors manually, but the above script block does not catch errors related to object manipulation like the example. I tried wrapping the entire keyword test in a try...catch block, and that was what brought about the question of retrieving the error message in the first place. Here's a screenshot: http://screencast.com/t/a0SrRDyccPD
Related Content
- 2 years ago
- 6 years ago
- 3 months ago
Recent Discussions
- 2 days ago
- 2 days ago
- 6 days ago