Ask a Question

Navigate to page taking a long time

nastester
Regular Contributor

Navigate to page taking a long time

I am testing some functionality where if I navigate to a URL while logged in as a user with certain rights, they cannot access the page. 

A browser popup appears and when clicked, they are redirected back.

 

The issue I am facing is the Navigate is taking a long time but it doesn't fail and eventually my assertion and button click on the popup work.

I tried setting the Auto-Wait Timeout on the navigation to 2 seconds but it is still taking so long.

 

Any ideas what I can do to speed this up? 

 

7 REPLIES 7
Marsha_R
Champion Level 3

How long does it take if you do the steps manually? Also, can you show us the code you are using for the Navigate and the waiting?

CristianE
Occasional Contributor

I don't know if I understood your scenario. 

 

But here are some suggestions:

-  after using the navigate method, you can add a new line to wait for the new popup window, or a child element, or a property from the newly loaded page

- maybe the page is hidden in the background but the automation-driver (the one that sees the Tree elements) can see the elements and 'bypass' your assertion'. In this case, try to find an element from your page after is loaded and use WaitProperty method on it, for VisibleOnScreen property.

- try another way to assert your step (not based on navigate result method)

nastester
Regular Contributor

Doing it manually is fast. I just navigate to the URL and hit the popup and click Ok and am redirected back. 

I have the steps in a Keyword test and it's just a Navigate operation and a Property Checkpoint. But it takes like 30 seconds to complete the Navigate step.

 

Here's the converted code with the timeout I set on the Navigate:

 

var TimeoutValue;
TimeoutValue = Options.Run.Timeout;
Options.Run.Timeout = 2000;
Browsers.Item(btChrome).Navigate("https://website.com/page");
Options.Run.Timeout = TimeoutValue;
aqObject.CheckProperty(Aliases.browser.page.Alert.labelMessage, "Text", cmpEqual, "User access restricted for this feature");

It's okay to show us screenshots of the keyword test if that's what you are actually running.

nastester
Regular Contributor

The issue is truly with the Navigate step, not the popup assertion. 

I run the navigate and it takes a minute to "finish".

 

What I "see" is the webpage is immediately navigated to in the browser and the pop up is displayed but it keeps running for a minute.

nastester
Regular Contributor

It is literally just this.  The Navigate step is taking around a minute to complete before the Property Checkpoint runs. It must be because when I navigate to that URL there is a popup which is somehow delaying the completion of the Navigate step in a timely manner but I don't know why.

Capture.PNG

I would try one of the other two methods listed here and see if that fixes it:

https://support.smartbear.com/testcomplete/docs/app-testing/web/common-tasks/navigating-to-pages.htm...

cancel
Showing results for 
Search instead for 
Did you mean: