Forum Discussion

dbaechtel's avatar
dbaechtel
Contributor
11 years ago

Why does Call Browsers.CurrentBrowser.Navigate take so long?

In my code I am using
Call Browsers.CurrentBrowser.Navigate(Param1)
where Param1 is the URL that I want to Navigate to.

Even though it takes less than 3 seconds to navigate to the URL requested, it takes TestComplete over 1 minute to timeout and to recognize that the Navigation is completed. It works OK, but why does TestComplete take so long?

This delay seriously impacts the Test execution time.

Why changes do I have to make so that this statement is executed more efficiently?

5 Replies

  • I appreciate the suggestion.

    I don't know how long the Timeout should be.
    Sometimes it is almost immediate, sometimes it can take a many seconds.

    Why doesn't TestComplete continue as soon as the Navigation takes places?
    Why does TestComplete have to timeout before it continues, even though the Navigation has completed long ago?

    The timeout might cause my Test to fail if it is too short. That is bad.
    I want to wait as long as it takes, but I need the test to execute more efficiently.

  • Ryan_Moran's avatar
    Ryan_Moran
    Valued Contributor
    It's actually waiting for everything on the page to finish loading. This probably takes longer than you would imagine. Just navigating to a web page and having information show up doesn't mean the page is done loading. So to prevent errors they have a wait time. May seem slow but the net result is more stability.
  • Why does every URL that I use Call Browsers.CurrentBrowser.Navigate to navigate to take the full timeout, about a minute, before TestComplete continues execution. Every page, every time. This is not because each page takes that long to load its contents.

    If I specify a timeout of 5 seconds, it works fine and TestComplete continues execution without error.

    But I don't want to specify a timeout. I want TestComplete to take as much time as is needed, but no more.

    TestComplete should not require a timeout in order to continue execution an certainly should not require about a minute for every page.

    What is wrong here?
  • Does web browser indicates that loading completed or it is still showing its throbber?

    In what web browser do you have this issue?

    Can you reproduce this issue with another web browser?

    What URL you are navigating to and what URL is actually opened?