Forum Discussion

jsan's avatar
jsan
Occasional Contributor
8 years ago

How to test fast changing items?

Hi, so this is the scenario.

 

There is a search box that user keys in stuff to. This then fires an API request and the text "Searching..." is shown while request is pending. The text then disappears (removed from DOM) when the request is finish. I would like to test that this text does show up.

 

Pseudo code:

TextboxSearch.Keys("apples") #Line 1
CheckProperty(obj, "contentText", cmpEqual, "Searching...") #Line 2

The request response is really fast but slow enough that user still sees the "Searching..." text. The problem I'm having is that TestComplete (TC) is "slow" and seems like line #2 is not yet executed by the time the text disappears after finishing searching for apples and so the test fails.

 

I have also tried executing the property check first with Runner.CallObjectMethodAsync() then do the keys but it does not work with TC methods as stated on the documentation.

 

Any ideas?

6 Replies

    • jsan's avatar
      jsan
      Occasional Contributor

      I have changed project playback properties; Delay between events, Key pressing delay to zero ms and still same issue.

       

      What's odd is that if I do a Log.Message() for contentText after keys is that it sees it just fine. Not sure why CheckProperty() does not.

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        Have you tried recording a script and just clicking on the "Searching" box to find out if TC can actually see it?