Forum Discussion

whuang's avatar
whuang
Regular Contributor
4 years ago
Solved

why my page wait method doesn't work?

Hi there,

 

I was using Aliases.browser.Page("*Admin/Alerts/AlertTemplateDetails.aspx*").Wait(30000) to ask TC wait for the page was loaded, but as you can see in the screenshot, it looks like TC could recognized the page and it logged an error after just around 4 seconds saying the page was not found. Did I code it wrong? Can anyone tell me how I can fix it?

 

Thanks in advance

  • Hi,

     

    There was only chrome running at that time.

    Can you double-check this using the Details tab of Task Manager?

    My expectation is that there is more than one browser process exists in the system and TestComplete picks up the one that is not visible and thus does not have Page which TestComplete tries to wait for and fails after timeout.

     

8 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    page was not found.

    According to this error message you should figure-out why this page is not found by TestComplete. As soon as the page is recognized by TestComplete .Wait() method should work.

     

    • whuang's avatar
      whuang
      Regular Contributor

      That was exactly my question, I am not sure why it was not recognized by TC.

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        If the problem is still actual...

         

         Aliases.browser.Page("*Admin/Alerts/AlertTemplateDetails.aspx*").Wait(30000)

        Can you let us know:

        a) how 'browser' alias is defined in your NameMapping; and

        b) how many browsers (including those that are not visible on screen) are running in your system at the moment of test execution?

         

  • ApplePen's avatar
    ApplePen
    Community Leader

    The wait method is correct. This method should apply in page object.

    But I think the alert page is a window object not a page.

    Please check the alert object in Object Browser.

    Or use FindChild method instead by wait method.

    • whuang's avatar
      whuang
      Regular Contributor

      I checked the alert page in TC, and it is a page object as you can see in the screenshot below.

      I also have another case waiting for the Office365 web mail page failed for the same error.