Forum Discussion

rjqajob's avatar
rjqajob
Occasional Contributor
15 years ago

refresh page

When I execute my script in TestComplete6, it opens the application and clicks one of the links on home page and display the following error "Internet Explorer cannot display the web page". In order to continue my script execution successfully, I need to press F5 key manually on key board for page refresh. Can any body suggest how to solve this issue with out manual interference.

5 Replies

  • Hi,




    Place the code below after the line where the click is performed:




        //JScript


        var AW = Sys.Desktop.ActiveWindow();

        AW.Page("*").Keys("[F5]");




  • rjqajob's avatar
    rjqajob
    Occasional Contributor
    Hi Alex,



    Thank you.I am using VBscript.Please can you send me VBScript code for page refresh.
  • Hi,




    Here is the VBScript code:




        ' VBScript


        Dim AW

        Set AW = Sys.Desktop.ActiveWindow()

        Call AW.Page("*").Keys("[F5]")




  • rjqajob's avatar
    rjqajob
    Occasional Contributor
    Hi Alex,



    Still I have problem in refreshing page.Please see the script beolw.



    Sub QC_Links

     Call QC_Initialize

     Call Close_IE

     

      Dim p1

      Dim w1

      Dim AW

     

      TestedApps.iexplore.Run

     

     Set p1 = Sys.Process("iexplore")

      p1.Page("https://localhost/easylink/").Panel("pagewidth").Table(0).Cell(2, 0).Panel("content").Panel("contentContainer").Panel(0).Table(0).Cell(1, 1).Link(0).Click

      Set w1 = p1.Page("https://localhost/LabManager/EasyQC/views/period/ControlDashboard.faces?auth=Y")

     

      Set AW = Sys.Desktop.ActiveWindow()

      Call AW.Page("*").Keys("[F5]")

     

      Call w1.Panel("container").Panel(0).Table("middle").Cell(0, 1).Panel(0).Panel(0).Panel("dashboardLinksContainer").Link(2).Panel(0).TextNode(1).Click(233, 33)

      w1.Panel("container").Panel(0).Table("middle").Cell(0, 0).Panel(0).Link(3).Click

      w1.Panel("container").Panel(0).Table("middle").Cell(0, 0).Panel(0).Link(4).Click

      w1.Panel("container").Panel(0).Table("middle").Cell(0, 0).Panel(0).Link(5).Click

     

      Call Close_IE

    End Sub


  • Hi,






    It is a bit strange as your code works fine for me. Nevertheless, I can suggest that you call the native Refresh method of the page object: