Forum Discussion

r_ahmakov's avatar
r_ahmakov
Occasional Contributor
9 years ago

Variable delay time

Hi,   can I set a varible delay operation, so that I can performance slower and sometimes faster tests?
  • bo_roop's avatar
    bo_roop
    9 years ago

    We use the WaitAliasChild in the same way that you mentioned WaitChild.

     

    var gmailPanel = Aliases["browser"]["pagegmail"]["gmailpanel"]

    gmailPanel["WaitAliasChild"]( "linkPreviewAttachment", 30000)

    In the example above, gmailPanel is the parent object (a panel inside of gmail in your web browser) and we are waiting for the Preview Attachment link (both are present in the NameMapping file).

     

    I like using WaitAliasChild because it's easier to debug (in my opinion). When the logic fails to find the control in the 30 seconds, I can go into the NameMapping editor and find the alias ["browser"]["pagegmail"]["gmailpanel"]["linkPreviewAttachment"] and right click to highlight the object.

     

    If it can't be found, I can then point at the object in my application and when the result is returned I can see what properties are different from the NameMapping alias and make the appropriate changes/updates to the Alias. If they are all the same, that means there is more than one control that matches the saved properties and TestComplete can't differentiate between them.

     

    Either way, this gives me a better starting point for debugging.

     

    Ultimately, when you say that WaitChild doesn't work, it means that your child control isn't found by TestComplete... you need to go figure out why.

     

    Good luck!