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

            Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

            Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

            How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page