Forum Discussion
witte
14 years agoOccasional Contributor
In addition to my last post:
=================
Object should be found if you use the wildcards as in following example:
=> Sys.Process("myappl").SWTObject("Shell*",
"Myapplication - *").SWTObject("Composite", "", 5)
But I'd like to give you a notice for better scripting. It's not a patch on you!
1) you shouldn't use capture and replay without changing some code. This is because names or indexes and so on may change during test and test script has to be changed evry time. This is not effective :-)
2) Use variable and check if object exists, then further on with next steps. That makes more stable the testrun.
=> Example:
var appName = "myappl";
var application = Sys.Process(appName);
//use any unique property or more if neccessary
if(application["FindChild"]("ObjectIdentifier", "Myapplication - *", 10, true)["Exists"]){
myApp = application["FindChild"]("ObjectIdentifier", "Myapplication - *", 10,false);
//if you need the index too, then define array with params and values
myApp["FindChild"]("Name", "Composite", 5, true);
}
=================
Object should be found if you use the wildcards as in following example:
=> Sys.Process("myappl").SWTObject("Shell*",
"Myapplication - *").SWTObject("Composite", "", 5)
But I'd like to give you a notice for better scripting. It's not a patch on you!
1) you shouldn't use capture and replay without changing some code. This is because names or indexes and so on may change during test and test script has to be changed evry time. This is not effective :-)
2) Use variable and check if object exists, then further on with next steps. That makes more stable the testrun.
=> Example:
var appName = "myappl";
var application = Sys.Process(appName);
//use any unique property or more if neccessary
if(application["FindChild"]("ObjectIdentifier", "Myapplication - *", 10, true)["Exists"]){
myApp = application["FindChild"]("ObjectIdentifier", "Myapplication - *", 10,false);
//if you need the index too, then define array with params and values
myApp["FindChild"]("Name", "Composite", 5, true);
}