Navigate to page taking a long time
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Labels:
-
Keyword Tests
-
Script Tests
-
Test Run
-
Web Testing
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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");
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's okay to show us screenshots of the keyword test if that's what you are actually running.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would try one of the other two methods listed here and see if that fixes it:
