coded ui tests - When would you use the UITestControl.Find method? -
when checking whether page/screen has loaded, use uitestcontrol.waitforcontrolexist() method, finding example code follows ctl.waitforcontrolexist() otherctl.find() calls on parent controls. this:
var tab = uimainmenuextwindow.uiitemwindow.uiribbonclient.uisolutionstabpage; tab.waitforcontrolexist(3000); uimainmenuextwindow.find(); uimainmenuextwindow.uiitemwindow.find(); uimainmenuextwindow.uiitemwindow.uiribbonclient.find(); uimainmenuextwindow.uiitemwindow.uiribbonclient.uisolutionstabpage.find(); tab.find(); mouse.click(tab);
does code make sense? purpose of 'find()' calls?
after setting searchproperties
, filterproperties
etc ui control, find
method causes search performed. commonly find
not called explicitly (or possibly equivalent internal method) called implicitly when ui control evaluated in expression parent of control.
consider:
this.uimap.uitoplevel.actionmethod();
in above statement value of uitoplevel
must evaluated find object actionmethod
can called. evaluation requires find
method.
the find
method may need called explicitly when application replaces part of display identical copy. ui controls, when first evaluated, reference original copy of control. when test tries access second version may "control not found" or "hidden control" exception (forget exact terminology of these exceptions). re-evaluating control, ie calling find
method explicitly, new version of control can found.
Comments
Post a Comment