Forum Discussion
3 Replies
Sort By
- denioflavioOccasional Contributoryou can also use the wait* methods, for instance:
waitProcess
waitWindow
waitVCLObject,
and others...
Sample:
if (Sys.Process('tab_veic').Exists) then
-> throw a log error if the process does not exists.
if (Sys.waitProcess('tab_veic', 2000).Exists) then
->its doesnt throw a log error.
-> 2000 is the timeout, in miliseconds - scott_staniewicOccasional ContributorI was wondering the same thing. If I do an IF Else statement looking to see if an object Exists or not Exists, the code works but always throws an error in the TC logs causing the test to fail. What can I do to stop the error in the TC logs.... Unable to find the object.
In my case the object can sometimes have 1 value or another so I'm looking to see if 1 value doesn't exist and if true use the other value.
if (!(control.VBObject("fraSettings").VBObject("fraBlockExpression")).Exists){
Log.Message("Value is not fraSettings it is fraSettings_2","",pmNormal,Attr);
control2 = control.VBObject("fraSettings_2").fraBlockExpression;}
else
{ Log.Message("Value is fraSettings","",pmNormal,Attr);
control2 = control.VBObject("fraSettings").fraBlockExpression;} - sshahinOccasional ContributorFigured it out.
Set p = Sys.Process(MyProcess)
Set w = p.FindChild("WndCaption", "FindObjectContainingThisTextInWndCaption", 5)
If w.Exists Then
...
End If
The test will not fail if w.Exists is false.
FindChild method: http://support.smartbear.com/viewarticle/28019/
Related Content
- 2 years agoaadzhigitov
- 10 months agoMW_Didata
- 12 years agokirk_bottomley
- 11 months agoMW_Didata
- 4 years agoshaiyoni
Recent Discussions
- 2 hours agosimonaferrara
- 11 hours agoSubhraDas
- 2 days agotramuntana