Forum Discussion

Nav15aug's avatar
Nav15aug
New Contributor
6 years ago

Waitporperty for webControl

Using waitProperty to verify contentText(Numeric Value) of a control on web page.

 

Once the count is increased and page is refreshed the waitporperty is not able to pick it and verify it.

 

WaitProperty,Inprogress,contentText,6,120,,

 

4 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Not sure what the question/problem is, but if

    > the count is increased and page is refreshed

    then the target object might become invalid and must be obtained a-new.

     

    Correct actions sequence:

    -- Click some control that triggers an action;

    -- Wait for the page obtained;

    -- Search for/wait until the target control appears on the page;

    -- Wait until its property obtains required value.

     

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      In addition to what AlexKaras mentions, if you have your "WaitProperty" waiting for a value (say, 10), and each time you run the test that number increases, then yes, this won't work for you.  Instead of waiting for a static value, you need to make your test "smarter".

       

      We do something similar and here's how we check it.

       

      1) BEFORE we execute the main part of the test, we navigate to the control and capture in a variable the value currently present.

      2) We then perform the test actions.

      3) Then we go back to that control and use the previously stored value to check for the new value.  We use such checks as "is greater than" or, if we know that we're expecting an increase of 1, we do a check where we wait for the property to be the previously stored value + 1.

       

       

      • Nav15aug's avatar
        Nav15aug
        New Contributor

        The value being pushed is from another application and its automated. It takes time for that value to be pulled up on page, so using waitproperty to wait for it to get updated. Once it gets updated the waitproperty is not able to verify it and the script fails.

         

        As per @AlexKaras - once the page is refreshed the control gets changed then how to handle this.