-1

I am working on web application, using tool testcomplete with vbscript. pageTab = Sys.Process("iexplore").IEFrame(0).CommandBar.TabBand.TabButton("Tieto Client Manager").Enabled

  do while(pageTab <> True)
      Sys.Process("Explorer").Refresh 
      pageTab = Sys.Process("iexplore").IEFrame(0).CommandBar.TabBand.TabButton("Tieto Client Manager").Enabled
      Sys.Process("iexplore").IEFrame(0).CommandBar.TabBand.TabButton("Tieto Client Manager").Refresh
  loop


  pageBusyState = Sys.Process("iexplore" , 2).Page("*").Busy
    do while(pageBusyState <> False)
    pageBusyState = Sys.Process("iexplore" , 2).Page("*").Busy
  loop 

With this code i can wait for new page but not able to wait for control loading page.

user1053540
  • 39
  • 1
  • 1
  • 5
  • Which version of TestComplete do you have? It is unclear what exactly task you want to achieve with your code. Please clarify what you mean by 'control loading page'. – Dmitry Nikolaev Aug 29 '13 at 06:23
  • I am using testcomplete 8.5. When I go to next page or do something on same page there is dynamic delay reqiured which i am not able to create. above are the ie properties i have used to wait but its not working 100%, – user1053540 Sep 03 '13 at 05:13

2 Answers2

0

The best approach to wait until a dynamic page is ready is to wait for a specific object on this page. For example, this can be the first object you need to work on the page. This approach is described along with a couple of other approaches in the Waiting For Web Pages help topic.

Dmitry Nikolaev
  • 3,803
  • 2
  • 19
  • 23
  • I can able to wait for page, but i am not able to wait if first object performing action, depends on first object second object will be enabled or disabled. In such case i want to wait for the specific control or the rest of the controls on the page. Consider page is fully loaded. – user1053540 Sep 10 '13 at 10:03
0
  Timeout=False

  'Check IEXPLORE Process running on window 

  If Sys.Process("IEXPLORE").Exists  Then

    Set obj = Sys.Process("IEXPLORE").Page("*") 
    Set PageObj = Eval(obj.FullName)
    'Set Default Timeout
    intDefaultTimeout=1000
    'Do until Page Object readyState=4 or Timeout
    Do  
      Set PageObj= Sys.Process("IEXPLORE").Page("*")
      'Check for Timeout
      If aqConvert.StrToInt(DateDiff("n",intTimerStart,Now))>= aqConvert.StrToInt(intDefaultTimeout)  Then
        Timeout=True
      End If
    Loop Until PageObj.ReadyState = 4 Or Timeout=True   

  Else 

     'Check iexplore 2 Process running on window 

    If Sys.Process("iexplore",2).Exists Then
      Set obj = Sys.Process("iexplore",2).Page("*") 
      Set PageObj = Eval(obj.FullName)
      'Set Default Timeout
      intDefaultTimeout=Project.Variables.prjDefaultTimeout
      'Do until Page Object readyState=4(page loaded fully or request finished and response is ready) or Timeout      
      Do  
        Set PageObj= Sys.Process("iexplore",2).Page("*")
        If aqConvert.StrToInt(DateDiff("n",intTimerStart,Now))>= aqConvert.StrToInt(intDefaultTimeout)  Then
          Timeout=True
        End If
        'Check still the page is in busy mode or page loaded fully .
      Loop Until PageObj.ReadyState = 4  Or Timeout=True 
    End If   
  End If 

 'Calling Activate method to apply a property collection corresponding to a run mode   
  PageObj.Activate
Pranav Singh
  • 17,079
  • 30
  • 77
  • 104
Amaresha
  • 1
  • 1