Forum Discussion

LAB's avatar
LAB
Contributor
6 years ago
Solved

Dynamic "Wait" equivalent in keyword?

I have objects on a web page that are loading independently from other objects, but I have to wait for them to all be finished loading before I can navigate away from the page.

 

It seems like the wait function is what I want, but not sure that really exists in keyword functions. I tried putting in an if/then statement that said "if the condition is met, navigate away", but that just skips the navigate if the condition isn't met in time.... 

 

I'm thinking possible solutions would be

 

1. insert a code snippet, assuming I can say "wait for alias.property = x"

2. Put in an if/then statement that triggers on negative condition, (field is not loaded) and route that to a 30s delay, but that feels a little hacky.

 

Is there an equivalent to the wait function I could use that would still be dynamic?

  • Any method that is on an onscreen object can be called in a keyword test.  So, you can use WaitProperty, WaitChild, WaitAliasChild, etc., in a keyword test by simply using the "On screen action" operation.

     

    You can also, as parameters of any operation, use a "Code Expression"  where you can write a script expression to be executed... again, using such things as WaitChild, etc.

     

    You can even "Run Code Snippet" as an operation in keyword tests to execute an expression outside of any other action.

     

    And finally, if there is particular detection or functionality that you know you can do in script but can't figure out in Keyword tests.... you can write a script routine and use "Run Script Routine" in a Keyword test to execute particular logic and such.

     

    In our projects... we use all of the above, depending upon the specific need.

2 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Any method that is on an onscreen object can be called in a keyword test.  So, you can use WaitProperty, WaitChild, WaitAliasChild, etc., in a keyword test by simply using the "On screen action" operation.

     

    You can also, as parameters of any operation, use a "Code Expression"  where you can write a script expression to be executed... again, using such things as WaitChild, etc.

     

    You can even "Run Code Snippet" as an operation in keyword tests to execute an expression outside of any other action.

     

    And finally, if there is particular detection or functionality that you know you can do in script but can't figure out in Keyword tests.... you can write a script routine and use "Run Script Routine" in a Keyword test to execute particular logic and such.

     

    In our projects... we use all of the above, depending upon the specific need.

    • LAB's avatar
      LAB
      Contributor

       

      never mind realized I was overthinking the whole problem good to know about all of the possible solutions but my problem was even more simple than that