Ask a Question

wait for Listview loaded

SOLVED
paarmann-ara
Contributor

wait for Listview loaded

I have a massive problem with testcomplete 🙂 .


My Listview has more than thousand tuple (row). So, I must waiting for listview to ListView complete loaded, after that start to click on upper Combobox. Now, the problem is that how can I find the listview is loaded completely?

 

Look to picture 0.jpg! a symbol for wait.


But how can I achieve this property to know the Listview is completely loaded and a wait symbol is not more in screen.

I have use wItemCount, but the problem for wItemCount is, she coming before wait-symbol disappear :-(.

9 REPLIES 9
Marsha_R
Champion Level 3

You check for the existence of the wait symbol every 2 or 3 seconds and when it's not there any more, then you're done.

Many thanks for your answer.
I have already a function for checking if object Exists. So, the ListView Exists but not loaded or Listview Exists but loaded not finished

 

 

Moreover the Wait-Symbol is not separated object. That is in ListView. I cannot catch a Wait-Symbol.

Hi,


Did You try to check and cound childCount prop or maybe specific to the list (like 'menuItem' in menu obj) "LisyItemProperty"?


Do for loop and check if number is change. If not then break the loop.

Thanks for your post.

Unfortunatly, I have just property like this Pichture. 1.jpg

There is no Property like Child or ChildCount

I think you can use ImageRepository Class.

 

Create the image from screen with loading spinner (If the spinner is moving, the photo may not be recognized, if it is moving, do only part of the loading message)

 

After that check in script for this image. Take a look at this one:

 

if(ImageRepository.obj.obj.Exists(Sys.Desktop));
    
function waitUntilObjectExist(obj, counter) {
  var counter = counter || 60;
  for (var i = 1; i <= counter; i++) {
    if (obj.Exists == true) {
      aqUtils.Delay(1000);
    } else {
      break;
    }
  }
}

Many Thanks for your solution 🙂

I use it:

def WaitForAvailablity(Object,ObjectName = " Nothing "):
        Options.Run.Timeout = Time.OptTimes('TinyTime')
        Delay(Time.OptTimes('MicroTime'))
        if Object is None or Object == 'nothing' or type(Object) == str:
                return 
        
        if not aqObject.IsSupported(Object,'Enabled'):      
                return 
            
        if aqObject.IsSupported(Object,'Exists'):
                while True:
                    if Object.Exists :
                        break
                    Delay(Time.OptTimes('TinyTime'))
        
        if aqObject.IsSupported(Object, 'Header') or aqObject.IsSupported(Object, 'HeaderControl'):
                Delay(Time.OptTimes('RegularTime'))
                Counter = 0
                while (Object.wItemCount > 100):
                        if not ImageRepository.Waiting.Wait.Exists(Object) or Counter > 40:
                                break
                        Delay(4000)
                        Counter +=1
                        
        if not Object.Enabled:
                return False
        return True

 

but that is not fast 😞

I'm glad I could help.

 

Is the Delay(4000) time at this value necessary?

At first MAny thanks for your help (bow)

 

I want say Yes and also that's not enough. So, sometimes I faced with a Listview that have more than 100K tuple and 100 attributes. 🙂

 

cancel
Showing results for 
Search instead for 
Did you mean: