cancel
Showing results for 
Search instead for 
Did you mean: 

wait for Listview loaded

SOLVED
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 :-(.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Leader

Re: wait for Listview loaded

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;
    }
  }
}

View solution in original post

9 REPLIES 9
Highlighted
Community Hero

Re: wait for Listview loaded

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.

Contributor

Re: wait for Listview loaded

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

 

 

Contributor

Re: wait for Listview loaded

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

Community Leader

Re: wait for Listview loaded

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.

Contributor

Re: wait for Listview loaded

Thanks for your post.

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

There is no Property like Child or ChildCount

Community Leader

Re: wait for Listview loaded

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;
    }
  }
}

View solution in original post

Contributor

Re: wait for Listview loaded

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 :-(

Community Leader

Re: wait for Listview loaded

I'm glad I could help.

 

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

Contributor

Re: wait for Listview loaded

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. :-)

 

New Here?
Join us and watch the welcome video:
Top Kudoed Authors