Forum Discussion

Buldog's avatar
Buldog
Occasional Contributor
14 years ago

Sys.refresh problem

Hello



In the script i am  using sys.refresh (). When the script is run, Sys.refresh () sometimes works, sometimes not (Object tree is not updated.) I can not understand why this is happening. I tried it in TC7 and TC8, the problem is the same



Delay 3 seconds added before Sys.refresh () and after - that not help



Example:

Code line

.........

Sys.refresh ()



Set p = Sys.Process ("iexplore")

Set a = p.Window ("Internet Explorer_TridentDlgFrame", "Web Page", 1)

Call a.Close ()



Vehicle log

"Unexpected window"

Cannot obtain the window with the window class "Internet Explore_TridentDlgFrame"



At the time when there is a window if you stop the script manually and posmatret Object tree this window does not appear there. After pressing the Refresh all window becomes available in the object tree

Sys.Process ("iexplore"). Window ("Internet Explorer_TridentDlgFrame", "Web Page", 1)



May have an idea?



Thanks in advance




  • Buldog's avatar
    Buldog
    Occasional Contributor
    Thank you for the reply

    Does WaitWindow method support Firefox?
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    WaitWindow is a method that is wrapped around objects by TestComplete and is application/object independent.
  • Buldog's avatar
    Buldog
    Occasional Contributor
    Thanks for you answers



    the same problem with object tree refresh



    example:



    Call refreshobjects(1)'-------------------------check for exists Sys.process("iexplore").Window("IEFrame", "*", 1).Window("Shell  DocObject             View", "", 1).Window("Internet Explorer_Server", "", 1).Page("*").document.frames.frame("InlineFrame").document.all If not exists then object tree refresh-------------------------------------------------



    if  Sys.process("iexplore").Window("IEFrame", "*", 1).Window("Shell DocObject View", "", 1).Window("Internet Explorer_Server", "", 1).Page("*").document.frames.frame("InlineFrame").document.all.exists = true then



    Set line = Sys.process("iexplore").Window("IEFrame", "*", 1).Window("Shell DocObject View", "", 1).Window("Internet Explorer_Server", "", 1).Page("*").document.frames.frame("InlineFrame").document



    Set linenext = line.all

    Call pageLoad(line)'-------script check object document property readyState for the status "complete"----------------------------------



    Call Find(linenext, "Button")'-----here script want to find object which have innertext "Button"







    When is calling Find procedure some time frow the error

    After procedure Find frow the exeption to the TC log:

    exeption:

    An exception occurred in the "TEST" unit at line 798:

    Microsoft VBScript runtime error

    Object doesn't support this property or method: 'row.Child(...).innerText'



    Microsoft VBScript runtime error:

    Object doesn't support this property or method: 'row.Child(...).innerText'

    Unit: "TEST" Line: 798 Column: 5.






  • Hi,



    Are you sure that the correct object is found and that it actually has the property you're trying to address? You can check this by evaluating Find's result on a breakpoint.
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    If you are using IE 8, keep in mind that there may be more than one instance of Sys.Process("iexplore").    You're looking at the default instance (instance index of 1).  It's possible that what you are looking for may be on index 2, or 3, or something else.



    Take a look in your object browser and see what instance of iexplore you are looking at when you're looking at the component you're trying to find.