How do I get URL if page isn't completely loaded and my webdriver desired waiting time is already over?2019 Community Moderator ElectionPage load strategy for Chrome driver (Updated till Selenium v3.12.0)Do we have any generic funtion to check if page has completely loaded in SeleniumSelenium IE WebDriver only works while debuggingHow slow are Java exceptions?How to modify the URL without reloading the page?How to get the browser to navigate to URL in JavaScriptWait for page load in SeleniumIEDriver Wait Loading pageHow to wait for page to load completely using JavaScript in SeleniumHow to get webDriver to wait for page to load (C# Selenium project)Can't make webdriver to wait for page to loadC# - Selenium - How to wait until page is fully loadedSelenium webdriver new tab URL is not loaded properly

Doesn't allowing a user mode program to access kernel space memory and execute the IN and OUT instructions defeat the purpose of having CPU modes?

Why would one plane in this picture not have gear down yet?

What's the "normal" opposite of flautando?

What does "the touch of the purple" mean?

How did Alan Turing break the enigma code using the hint given by the lady in the bar?

Contract Factories

Can you reject a postdoc offer after the PI has paid a large sum for flights/accommodation for your visit?

Does a warlock using the Darkness/Devil's Sight combo still have advantage on ranged attacks against a target outside the Darkness?

Do I really need to have a scientific explanation for my premise?

What problems would a superhuman have whose skin is constantly hot?

Latex does not go to next line

Hotkey (or other quick way) to insert a keyframe for only one component of a vector-valued property?

Accepted offer letter, position changed

Makefile strange variable substitution

Good for you! in Russian

Virginia employer terminated employee and wants signing bonus returned

Is it possible to avoid unpacking when merging Association?

What was the Kree's motivation in Captain Marvel?

Why the color red for the Republican Party

PTIJ: Should I kill my computer after installing software?

What are actual Tesla M60 models used by AWS?

Is it "Vierergruppe" or "Viergruppe", or is there a distinction?

Motivation for Zeta Function of an Algebraic Variety

What Happens when Passenger Refuses to Fly Boeing 737 Max?



How do I get URL if page isn't completely loaded and my webdriver desired waiting time is already over?



2019 Community Moderator ElectionPage load strategy for Chrome driver (Updated till Selenium v3.12.0)Do we have any generic funtion to check if page has completely loaded in SeleniumSelenium IE WebDriver only works while debuggingHow slow are Java exceptions?How to modify the URL without reloading the page?How to get the browser to navigate to URL in JavaScriptWait for page load in SeleniumIEDriver Wait Loading pageHow to wait for page to load completely using JavaScript in SeleniumHow to get webDriver to wait for page to load (C# Selenium project)Can't make webdriver to wait for page to loadC# - Selenium - How to wait until page is fully loadedSelenium webdriver new tab URL is not loaded properly










0















I've been trying to extract the URL if the page hasn't finished loading but I want the URL if driver wait time(10 sec) is over and moves to throw a custom exception.
I've tried window.location.href, window.location.pathname, etc but they returns null.










share|improve this question









New contributor




Harshit Gupta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • It seems like that Javascript API's don't reflect the current URL until the page is loaded. I've witnessed some odd behavior with iOS when I was debugging early Angular digest cycles where the location property wasn't immediately updated. How are you setting the URL? That would be where I would look. Is this a result of a redirect? How is the browser getting into a state where there's an "unknown" navigation event that wasn't triggered by your webdriver code?

    – Sean Aitken
    Mar 7 at 7:12
















0















I've been trying to extract the URL if the page hasn't finished loading but I want the URL if driver wait time(10 sec) is over and moves to throw a custom exception.
I've tried window.location.href, window.location.pathname, etc but they returns null.










share|improve this question









New contributor




Harshit Gupta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • It seems like that Javascript API's don't reflect the current URL until the page is loaded. I've witnessed some odd behavior with iOS when I was debugging early Angular digest cycles where the location property wasn't immediately updated. How are you setting the URL? That would be where I would look. Is this a result of a redirect? How is the browser getting into a state where there's an "unknown" navigation event that wasn't triggered by your webdriver code?

    – Sean Aitken
    Mar 7 at 7:12














0












0








0








I've been trying to extract the URL if the page hasn't finished loading but I want the URL if driver wait time(10 sec) is over and moves to throw a custom exception.
I've tried window.location.href, window.location.pathname, etc but they returns null.










share|improve this question









New contributor




Harshit Gupta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I've been trying to extract the URL if the page hasn't finished loading but I want the URL if driver wait time(10 sec) is over and moves to throw a custom exception.
I've tried window.location.href, window.location.pathname, etc but they returns null.







javascript java selenium pageload webdriverwait






share|improve this question









New contributor




Harshit Gupta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Harshit Gupta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Mar 7 at 7:03









DebanjanB

44k114386




44k114386






New contributor




Harshit Gupta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Mar 7 at 6:39









Harshit GuptaHarshit Gupta

1




1




New contributor




Harshit Gupta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Harshit Gupta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Harshit Gupta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • It seems like that Javascript API's don't reflect the current URL until the page is loaded. I've witnessed some odd behavior with iOS when I was debugging early Angular digest cycles where the location property wasn't immediately updated. How are you setting the URL? That would be where I would look. Is this a result of a redirect? How is the browser getting into a state where there's an "unknown" navigation event that wasn't triggered by your webdriver code?

    – Sean Aitken
    Mar 7 at 7:12


















  • It seems like that Javascript API's don't reflect the current URL until the page is loaded. I've witnessed some odd behavior with iOS when I was debugging early Angular digest cycles where the location property wasn't immediately updated. How are you setting the URL? That would be where I would look. Is this a result of a redirect? How is the browser getting into a state where there's an "unknown" navigation event that wasn't triggered by your webdriver code?

    – Sean Aitken
    Mar 7 at 7:12

















It seems like that Javascript API's don't reflect the current URL until the page is loaded. I've witnessed some odd behavior with iOS when I was debugging early Angular digest cycles where the location property wasn't immediately updated. How are you setting the URL? That would be where I would look. Is this a result of a redirect? How is the browser getting into a state where there's an "unknown" navigation event that wasn't triggered by your webdriver code?

– Sean Aitken
Mar 7 at 7:12






It seems like that Javascript API's don't reflect the current URL until the page is loaded. I've witnessed some odd behavior with iOS when I was debugging early Angular digest cycles where the location property wasn't immediately updated. How are you setting the URL? That would be where I would look. Is this a result of a redirect? How is the browser getting into a state where there's an "unknown" navigation event that wasn't triggered by your webdriver code?

– Sean Aitken
Mar 7 at 7:12













1 Answer
1






active

oldest

votes


















0














Window Location



The JavaScript window.location object can be used to get the current page address (URL) and to redirect the browser to a new page. The window.location object can be written without the window prefix. Some examples:




  • window.location.href: returns the href (URL) of the current page


  • window.location.hostname: returns the domain name of the web host


  • window.location.pathname: returns the path and filename of the current page


  • window.location.protocol: returns the web protocol used (http: or https:)


  • window.location.assign: loads a new document


Page completely not loaded



Unfortunately, there is no generic step to check if page has completely loaded through Selenium. However there are certain approaches to ensure that the page is completely loaded using the following strategies:



  • pageLoadStrategy

  • Wait for the Browser Client attaining 'document.readyState' equal to "complete"

  • Induce WebDriverWait inconjunction with ExpectedConditions as:


    • urlContains(): The expectation for the URL of the current page to contain specific text.


    • urlMatches(): The expectation for the URL to match a specific regular expression


    • urlToBe(): The expectation for the URL of the current page to be a specific url.



Note: You can find a detailed discussion in Do we have any generic funtion to check if page has completely loaded in Selenium







share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );






    Harshit Gupta is a new contributor. Be nice, and check out our Code of Conduct.









    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55037533%2fhow-do-i-get-url-if-page-isnt-completely-loaded-and-my-webdriver-desired-waitin%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Window Location



    The JavaScript window.location object can be used to get the current page address (URL) and to redirect the browser to a new page. The window.location object can be written without the window prefix. Some examples:




    • window.location.href: returns the href (URL) of the current page


    • window.location.hostname: returns the domain name of the web host


    • window.location.pathname: returns the path and filename of the current page


    • window.location.protocol: returns the web protocol used (http: or https:)


    • window.location.assign: loads a new document


    Page completely not loaded



    Unfortunately, there is no generic step to check if page has completely loaded through Selenium. However there are certain approaches to ensure that the page is completely loaded using the following strategies:



    • pageLoadStrategy

    • Wait for the Browser Client attaining 'document.readyState' equal to "complete"

    • Induce WebDriverWait inconjunction with ExpectedConditions as:


      • urlContains(): The expectation for the URL of the current page to contain specific text.


      • urlMatches(): The expectation for the URL to match a specific regular expression


      • urlToBe(): The expectation for the URL of the current page to be a specific url.



    Note: You can find a detailed discussion in Do we have any generic funtion to check if page has completely loaded in Selenium







    share|improve this answer





























      0














      Window Location



      The JavaScript window.location object can be used to get the current page address (URL) and to redirect the browser to a new page. The window.location object can be written without the window prefix. Some examples:




      • window.location.href: returns the href (URL) of the current page


      • window.location.hostname: returns the domain name of the web host


      • window.location.pathname: returns the path and filename of the current page


      • window.location.protocol: returns the web protocol used (http: or https:)


      • window.location.assign: loads a new document


      Page completely not loaded



      Unfortunately, there is no generic step to check if page has completely loaded through Selenium. However there are certain approaches to ensure that the page is completely loaded using the following strategies:



      • pageLoadStrategy

      • Wait for the Browser Client attaining 'document.readyState' equal to "complete"

      • Induce WebDriverWait inconjunction with ExpectedConditions as:


        • urlContains(): The expectation for the URL of the current page to contain specific text.


        • urlMatches(): The expectation for the URL to match a specific regular expression


        • urlToBe(): The expectation for the URL of the current page to be a specific url.



      Note: You can find a detailed discussion in Do we have any generic funtion to check if page has completely loaded in Selenium







      share|improve this answer



























        0












        0








        0







        Window Location



        The JavaScript window.location object can be used to get the current page address (URL) and to redirect the browser to a new page. The window.location object can be written without the window prefix. Some examples:




        • window.location.href: returns the href (URL) of the current page


        • window.location.hostname: returns the domain name of the web host


        • window.location.pathname: returns the path and filename of the current page


        • window.location.protocol: returns the web protocol used (http: or https:)


        • window.location.assign: loads a new document


        Page completely not loaded



        Unfortunately, there is no generic step to check if page has completely loaded through Selenium. However there are certain approaches to ensure that the page is completely loaded using the following strategies:



        • pageLoadStrategy

        • Wait for the Browser Client attaining 'document.readyState' equal to "complete"

        • Induce WebDriverWait inconjunction with ExpectedConditions as:


          • urlContains(): The expectation for the URL of the current page to contain specific text.


          • urlMatches(): The expectation for the URL to match a specific regular expression


          • urlToBe(): The expectation for the URL of the current page to be a specific url.



        Note: You can find a detailed discussion in Do we have any generic funtion to check if page has completely loaded in Selenium







        share|improve this answer















        Window Location



        The JavaScript window.location object can be used to get the current page address (URL) and to redirect the browser to a new page. The window.location object can be written without the window prefix. Some examples:




        • window.location.href: returns the href (URL) of the current page


        • window.location.hostname: returns the domain name of the web host


        • window.location.pathname: returns the path and filename of the current page


        • window.location.protocol: returns the web protocol used (http: or https:)


        • window.location.assign: loads a new document


        Page completely not loaded



        Unfortunately, there is no generic step to check if page has completely loaded through Selenium. However there are certain approaches to ensure that the page is completely loaded using the following strategies:



        • pageLoadStrategy

        • Wait for the Browser Client attaining 'document.readyState' equal to "complete"

        • Induce WebDriverWait inconjunction with ExpectedConditions as:


          • urlContains(): The expectation for the URL of the current page to contain specific text.


          • urlMatches(): The expectation for the URL to match a specific regular expression


          • urlToBe(): The expectation for the URL of the current page to be a specific url.



        Note: You can find a detailed discussion in Do we have any generic funtion to check if page has completely loaded in Selenium








        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 7 at 7:09

























        answered Mar 7 at 7:03









        DebanjanBDebanjanB

        44k114386




        44k114386






















            Harshit Gupta is a new contributor. Be nice, and check out our Code of Conduct.









            draft saved

            draft discarded


















            Harshit Gupta is a new contributor. Be nice, and check out our Code of Conduct.












            Harshit Gupta is a new contributor. Be nice, and check out our Code of Conduct.











            Harshit Gupta is a new contributor. Be nice, and check out our Code of Conduct.














            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55037533%2fhow-do-i-get-url-if-page-isnt-completely-loaded-and-my-webdriver-desired-waitin%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

            2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived

            Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme