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
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
New contributor
add a comment |
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
New contributor
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
add a comment |
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
New contributor
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
javascript java selenium pageload webdriverwait
New contributor
New contributor
edited Mar 7 at 7:03
DebanjanB
44k114386
44k114386
New contributor
asked Mar 7 at 6:39
Harshit GuptaHarshit Gupta
1
1
New contributor
New contributor
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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 pagewindow.location.hostname
: returns the domain name of the web hostwindow.location.pathname
: returns the path and filename of the current pagewindow.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 expressionurlToBe()
: 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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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 pagewindow.location.hostname
: returns the domain name of the web hostwindow.location.pathname
: returns the path and filename of the current pagewindow.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 expressionurlToBe()
: 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
add a comment |
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 pagewindow.location.hostname
: returns the domain name of the web hostwindow.location.pathname
: returns the path and filename of the current pagewindow.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 expressionurlToBe()
: 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
add a comment |
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 pagewindow.location.hostname
: returns the domain name of the web hostwindow.location.pathname
: returns the path and filename of the current pagewindow.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 expressionurlToBe()
: 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
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 pagewindow.location.hostname
: returns the domain name of the web hostwindow.location.pathname
: returns the path and filename of the current pagewindow.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 expressionurlToBe()
: 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
edited Mar 7 at 7:09
answered Mar 7 at 7:03
DebanjanBDebanjanB
44k114386
44k114386
add a comment |
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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