Forum Discussion

nastester's avatar
nastester
Regular Contributor
6 months ago

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

  • Marsha_R's avatar
    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?

    • nastester's avatar
      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");

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

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

  • CristianE's avatar
    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's avatar
      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.