How we can click on 'Href' link under Selenium Webdriver?How to maximize the browser window in Selenium WebDriver (Selenium 2) using C#?How to take screenshot with Selenium WebDriverSelenium c# Webdriver: Wait Until Element is PresentGet HTML Source of WebElement in Selenium WebDriver using PythonSelenium WebDriver - Test if element is presentHow to run Selenium WebDriver test cases in Chrome?extract an image by id or class name in selenium by using javaCan a website detect when you are using selenium with chromedriver?How to click on an image in selenium webdriverHTML unit driver with selenium not click the button
System.debug(JSON.Serialize(o)) Not longer shows full string
You cannot touch me, but I can touch you, who am I?
Method to test if a number is a perfect power?
What is the opposite of 'gravitas'?
Was Spock the First Vulcan in Starfleet?
For a non-Jew, is there a punishment for not observing the 7 Noahide Laws?
Risk of infection at the gym?
Gears on left are inverse to gears on right?
Two monoidal structures and copowering
Fastening aluminum fascia to wooden subfascia
Balance Issues for a Custom Sorcerer Variant
How do we know the LHC results are robust?
Do sorcerers' subtle spells require a skill check to be unseen?
What does "I’d sit this one out, Cap," imply or mean in the context?
How can I get through very long and very dry, but also very useful technical documents when learning a new tool?
How to pronounce the slash sign
How does Loki do this?
Customer Requests (Sometimes) Drive Me Bonkers!
Type int? vs type int
What can we do to stop prior company from asking us questions?
Is exact Kanji stroke length important?
Trouble understanding the speech of overseas colleagues
Purchasing a ticket for someone else in another country?
How does the UK government determine the size of a mandate?
How we can click on 'Href' link under Selenium Webdriver?
How to maximize the browser window in Selenium WebDriver (Selenium 2) using C#?How to take screenshot with Selenium WebDriverSelenium c# Webdriver: Wait Until Element is PresentGet HTML Source of WebElement in Selenium WebDriver using PythonSelenium WebDriver - Test if element is presentHow to run Selenium WebDriver test cases in Chrome?extract an image by id or class name in selenium by using javaCan a website detect when you are using selenium with chromedriver?How to click on an image in selenium webdriverHTML unit driver with selenium not click the button
I want to click on the href link as per attached image, And I've tried the below code but seems like it's not working. Please help me.
.....
driver.findElement(By.xpath("//a[@href='Careers']")).click();
............
Here is HTML content for Div tag...
..............
<div class="logo">
<img src="/ui/healthcare/assets/images/core/ascension_logo_white.svg" alt="Ascension">
</div>
<ul class="list-group">
<li>
<h4>Get Involved</h4>
<ul class="link-list">
<li><a href="/Careers">Careers</a></li>
<li><a href="/Events">Classes and Events</a></li>
........................
.....

selenium selenium-webdriver selenium-chromedriver
add a comment |
I want to click on the href link as per attached image, And I've tried the below code but seems like it's not working. Please help me.
.....
driver.findElement(By.xpath("//a[@href='Careers']")).click();
............
Here is HTML content for Div tag...
..............
<div class="logo">
<img src="/ui/healthcare/assets/images/core/ascension_logo_white.svg" alt="Ascension">
</div>
<ul class="list-group">
<li>
<h4>Get Involved</h4>
<ul class="link-list">
<li><a href="/Careers">Careers</a></li>
<li><a href="/Events">Classes and Events</a></li>
........................
.....

selenium selenium-webdriver selenium-chromedriver
add a comment |
I want to click on the href link as per attached image, And I've tried the below code but seems like it's not working. Please help me.
.....
driver.findElement(By.xpath("//a[@href='Careers']")).click();
............
Here is HTML content for Div tag...
..............
<div class="logo">
<img src="/ui/healthcare/assets/images/core/ascension_logo_white.svg" alt="Ascension">
</div>
<ul class="list-group">
<li>
<h4>Get Involved</h4>
<ul class="link-list">
<li><a href="/Careers">Careers</a></li>
<li><a href="/Events">Classes and Events</a></li>
........................
.....

selenium selenium-webdriver selenium-chromedriver
I want to click on the href link as per attached image, And I've tried the below code but seems like it's not working. Please help me.
.....
driver.findElement(By.xpath("//a[@href='Careers']")).click();
............
Here is HTML content for Div tag...
..............
<div class="logo">
<img src="/ui/healthcare/assets/images/core/ascension_logo_white.svg" alt="Ascension">
</div>
<ul class="list-group">
<li>
<h4>Get Involved</h4>
<ul class="link-list">
<li><a href="/Careers">Careers</a></li>
<li><a href="/Events">Classes and Events</a></li>
........................
.....

selenium selenium-webdriver selenium-chromedriver
selenium selenium-webdriver selenium-chromedriver
edited Mar 8 at 12:03
ajay kumar
asked Mar 8 at 11:13
ajay kumarajay kumar
285
285
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Try this below xpath
driver.get("https://healthcare.ascension.org/");
JavascriptExecutor js = ((JavascriptExecutor) driver);
js.executeScript("window.scrollTo(0, document.body.scrollHeight)");
JavascriptExecutor executor = (JavascriptExecutor) driver;
executor.executeScript("arguments[0].click();",driver.findElement(By.xpath("//a[@href='/Careers']")));
It's not working, It's showing 'Element is not displayed'
– ajay kumar
Mar 8 at 11:23
ok.wait for the element to load.
– Kajal Kundu
Mar 8 at 11:24
but I already define the wait.
– ajay kumar
Mar 8 at 11:26
try the modified code.
– Kajal Kundu
Mar 8 at 11:27
if it is not working check the if there anyiframeif it is you have to switch to iframe first.
– Kajal Kundu
Mar 8 at 11:29
|
show 2 more comments
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
);
);
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%2f55062026%2fhow-we-can-click-on-href-link-under-selenium-webdriver%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
Try this below xpath
driver.get("https://healthcare.ascension.org/");
JavascriptExecutor js = ((JavascriptExecutor) driver);
js.executeScript("window.scrollTo(0, document.body.scrollHeight)");
JavascriptExecutor executor = (JavascriptExecutor) driver;
executor.executeScript("arguments[0].click();",driver.findElement(By.xpath("//a[@href='/Careers']")));
It's not working, It's showing 'Element is not displayed'
– ajay kumar
Mar 8 at 11:23
ok.wait for the element to load.
– Kajal Kundu
Mar 8 at 11:24
but I already define the wait.
– ajay kumar
Mar 8 at 11:26
try the modified code.
– Kajal Kundu
Mar 8 at 11:27
if it is not working check the if there anyiframeif it is you have to switch to iframe first.
– Kajal Kundu
Mar 8 at 11:29
|
show 2 more comments
Try this below xpath
driver.get("https://healthcare.ascension.org/");
JavascriptExecutor js = ((JavascriptExecutor) driver);
js.executeScript("window.scrollTo(0, document.body.scrollHeight)");
JavascriptExecutor executor = (JavascriptExecutor) driver;
executor.executeScript("arguments[0].click();",driver.findElement(By.xpath("//a[@href='/Careers']")));
It's not working, It's showing 'Element is not displayed'
– ajay kumar
Mar 8 at 11:23
ok.wait for the element to load.
– Kajal Kundu
Mar 8 at 11:24
but I already define the wait.
– ajay kumar
Mar 8 at 11:26
try the modified code.
– Kajal Kundu
Mar 8 at 11:27
if it is not working check the if there anyiframeif it is you have to switch to iframe first.
– Kajal Kundu
Mar 8 at 11:29
|
show 2 more comments
Try this below xpath
driver.get("https://healthcare.ascension.org/");
JavascriptExecutor js = ((JavascriptExecutor) driver);
js.executeScript("window.scrollTo(0, document.body.scrollHeight)");
JavascriptExecutor executor = (JavascriptExecutor) driver;
executor.executeScript("arguments[0].click();",driver.findElement(By.xpath("//a[@href='/Careers']")));
Try this below xpath
driver.get("https://healthcare.ascension.org/");
JavascriptExecutor js = ((JavascriptExecutor) driver);
js.executeScript("window.scrollTo(0, document.body.scrollHeight)");
JavascriptExecutor executor = (JavascriptExecutor) driver;
executor.executeScript("arguments[0].click();",driver.findElement(By.xpath("//a[@href='/Careers']")));
edited Mar 8 at 12:17
answered Mar 8 at 11:19
Kajal KunduKajal Kundu
2,7511315
2,7511315
It's not working, It's showing 'Element is not displayed'
– ajay kumar
Mar 8 at 11:23
ok.wait for the element to load.
– Kajal Kundu
Mar 8 at 11:24
but I already define the wait.
– ajay kumar
Mar 8 at 11:26
try the modified code.
– Kajal Kundu
Mar 8 at 11:27
if it is not working check the if there anyiframeif it is you have to switch to iframe first.
– Kajal Kundu
Mar 8 at 11:29
|
show 2 more comments
It's not working, It's showing 'Element is not displayed'
– ajay kumar
Mar 8 at 11:23
ok.wait for the element to load.
– Kajal Kundu
Mar 8 at 11:24
but I already define the wait.
– ajay kumar
Mar 8 at 11:26
try the modified code.
– Kajal Kundu
Mar 8 at 11:27
if it is not working check the if there anyiframeif it is you have to switch to iframe first.
– Kajal Kundu
Mar 8 at 11:29
It's not working, It's showing 'Element is not displayed'
– ajay kumar
Mar 8 at 11:23
It's not working, It's showing 'Element is not displayed'
– ajay kumar
Mar 8 at 11:23
ok.wait for the element to load.
– Kajal Kundu
Mar 8 at 11:24
ok.wait for the element to load.
– Kajal Kundu
Mar 8 at 11:24
but I already define the wait.
– ajay kumar
Mar 8 at 11:26
but I already define the wait.
– ajay kumar
Mar 8 at 11:26
try the modified code.
– Kajal Kundu
Mar 8 at 11:27
try the modified code.
– Kajal Kundu
Mar 8 at 11:27
if it is not working check the if there any
iframe if it is you have to switch to iframe first.– Kajal Kundu
Mar 8 at 11:29
if it is not working check the if there any
iframe if it is you have to switch to iframe first.– Kajal Kundu
Mar 8 at 11:29
|
show 2 more comments
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%2f55062026%2fhow-we-can-click-on-href-link-under-selenium-webdriver%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