Forum Discussion

Kostja's avatar
Kostja
Contributor
9 years ago
Solved

wait for child to be loaded

Hello everybody,   i got a question regarding web testing.   I have my page which consists full of widgets which can be added or deleted. Since the structure of the page is dynamic and always cha...
  • AlexKaras's avatar
    AlexKaras
    9 years ago

    Hi,

     

    See http://support.smartbear.com/viewarticle/55112/ (or, even better, http://support.smartbear.com/viewarticle/66720/) for the description of the .FindChild() method.

    In your case, you should use either just

    var GVCntnt = MyDashCol1.FindChild('contentText','Configuration of this*Circular Gauge*',20);

    to search for the content of the widget, or, if this search is not accurate enough, then the code must be like that:

    var GVForm = MyDashCol1.FindChild(FormPropArray,FormValueArray,​20);
    var GVCntnt = GVForm.WaitChild('contentText','Configuration of this*Circular Gauge*', 15000);

     

    And yes, as the widgets and their data are obtained asynchronious after the main page has been loaded, the page.Wait() does not work in this case and the only reliable method that works is to search for the required child within some time interval (exactly what .FindChildEx() method does) and either continue with the found object or fail with the error if the sought for object did not appear within some reasonable timeout. (Well, probably this is not a functional problem if some object cannot be loaded within, say, 30 seconds, but obviously something that most of web users will not accept if not warned previously.)