Forum Discussion

sguda's avatar
sguda
Regular Contributor
14 years ago

Test Complete is not recognizing the wnd caption property of the IE page.

Hi in my keyword test i am using wait property method to wait for the WinCaption of the IE page to load.



This is the syntax i used. But looks like it is not recognizing and keep on waiting even after the page is opened with the same wnd caption.




Set StopWatchObj = HISUtils.StopWatch


StopWatchObj = .StopWatch

dim MyCell


MyResult = CBool(False)


 


 


StopWatchObj.Start


 


Set MyCell = Aliases.iexplore1.IEFrame


MyResult = MyCell.WaitProperty("WndCaption","http://qa2008/advantageV260/SY/ReportViewer.aspx - Internet Explorer, optimized for Bing and MSN",480000)


 


if MyResult = True then


StopWatchObj.Stop


Log.Message(" Crystal Blank Report Page appears. Execution time: " & StopWatchObj.ToString )


Else


Log.Message("Crystal Blank Report not Loaded.")


end if



Please suggest.

9 Replies

  • Looks OK to me. The first thing I'd check is that there isn't an extra space at the end of the actual caption. That happens quite frequently, and I usually use wildcards to avoid that sort of thing, like this:

    MyCell.WaitProperty("WndCaption","http://qa2008/advantageV260/SY/ReportViewer.aspx - Internet Explorer, optimized for Bing and MSN*",480000)
  • sguda's avatar
    sguda
    Regular Contributor
    I got the string from wnd caption property of that page. I looked at name mapping the wnd caption is looking as * for that page.



    I will try what you said.
  • sguda's avatar
    sguda
    Regular Contributor
    It didn't work for me.



    Actaullay what happens is there is this internert explorer page with some other caption , the page i am testing with the wnd caption i have given before overlay on the previous page. The page i am testing displays first as blank page. So i cannot test anything else on that page other than the caption.



    I created the property check point and it looks for the page and says Type Message Time Link

    The property value "Report Parameters - Progress Report - Multiple Students - Internet Explorer, optimized for Bing and MSN" does not equal the baseline value "http://qa2008/advantageV260/SY/ReportViewer.aspx - Internet Explorer, optimized for Bing and MSN". 



    I tried wait property using wnd caption of the page as i have given before and with * at the end still it is not recognizing the window and keeps on waiting even after the window opens up.
  • So you have multiple browser tabs open? In that case the IEFrame object is probably being mapped to the wrong tab, and your problem has nothing to do with the WaitProperty method.
  • sguda's avatar
    sguda
    Regular Contributor
    Hi Tony,

    I tried this.



    I created the object check point. for that overlying ie page. and set auto wait time for that object check point. It worked.



    My object of that page was Aliases.iexplore2.pageProgressReportMultipleStuden



    tried to write a routine to wait for this object and log the execution time when the page appears.




    sub GetObjectTime

    Set StopWatchObj = HISUtils.StopWatchd

    dim MyCell


    GetObjectTime StopWatchObj = .StopWatchd MyCell

    dim MyCellContent


     


    MyResult = CBool(False)


     


     


    StopWatchObj.Start


     


    Set MyCell = Aliases.iexplore2.pageProgressReportMultipleStuden


    Set MyResult = MyCell.WaitProperty("URL","http://qa2008/advantageV260/SY/ReportViewer.aspx", 480000)


     


    if MyResult = True then


    StopWatchObj.Stop


    Log.Message(" Crystal Blank Report Page appears. Execution time: " & StopWatchObj.ToString & ". Baseline Date: 05-12-2010, Baseline Execution time: 00:00:00.000")


    Else


    Log.Message("Crystal Blank Report not Loaded.")


    end if


     



    end sub



    I have three properties i can check for this object Name, URL. It says waiting for that page But looks like it is not waiting for the time i have specified. it is comming out and going to else loop.


    I have three properties i can check for this object Name, URL. It says waiting for that page But looks like it is not waiting for the time i have specified. it is comming out and going to else loop.Please tell me how to use this correctly.








  • sguda's avatar
    sguda
    Regular Contributor
    it is not multiple tabs but one page on the top of other.
  • So you're not actually interested in the WndCaption, you just want to know when a page has loaded? Why not use the Page.Wait function? That's what it's for. There's a section in the help specifically about waiting for pages to load.
  • sguda's avatar
    sguda
    Regular Contributor
    Hi Tony,



    I looked at that also. My goal is to wait for that pagewhich is overlays on another ie page from which it is invoked.



    I tried first  matching with waiting for wndcaption property and report the time it loaded.I have to report the execution time it took to load that page. Firts it is displaying blank page and after few seconds it displays content on the page.

    My goal is to find the time it takes to load blank page first and then the content page. When it displays actually the content the url of that page again is different.

    I am trying for blank page now.



    I tried matching with different this like URLproprty  etc... But it is not wiating for the time i specified . it is comming out.



    I saw PageObj.Wait() also. i could't get it work. i don't see proper examples in the help also.



    Can i use this way.



    Set MyUrl = Aliases.iexplore2.pageProgressReportMultipleStuden.Wait(480000)

    If MyUrl = "http://qa2008/advantageV260/SY/ReportViewer.aspx"   then

             Log message().......

    end if.





    Please let me know.

    That will be greatful.

    Thanks.

  • Hi Sri,





    Set MyResult = MyCell.WaitProperty("URL","http://qa2008/advantageV260/SY/ReportViewer.aspx", 480000)

    ...

    I have three properties i can check for this object Name, URL. It says waiting for that page But looks like it is not waiting for the time i have specified. it is comming out and going to else loop.


    The WaitProperty method returns a Boolean value which does not require the 'Set' operator to be assigned to a variable. Probably, this is the cause of the problem.





    MyResult = MyCell.WaitProperty("URL","http://qa2008/advantageV260/SY/ReportViewer.aspx", 480000)