How to click a particular link using selenium java?

+2 votes
I am searching a particular keyword and trying to click on a particular link. How to do that please help.
Dec 14, 2018 in Selenium by Nitesh
• 2,810 points
253 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

You can use the following steps to achieve your click result.

wd.get("https://www.google.com");//open google
WebElement elem = wd.findElement(By.name("q"));
elem.sendKeys(new String[]{"your keyword"}); 
elem.submit();
By.tagName("div");
By.className("r");
wd.findElement(By.partialLinkText("https://www.yourdesiredlink.com/")).click();
answered Dec 14, 2018 by Shuvodip

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to click a span with given text using Selenium Python

If ALL_USA is subject to change, then ...READ MORE

answered Jul 26, 2018 in Selenium by Samarpit
• 5,130 points
1,192 views
+2 votes
1 answer
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,030 points
71 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
441 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
55 views
0 votes
5 answers
+1 vote
2 answers

How to get the title of a webpage using Selenium Java?

Essentially, driver.getTitle(); function can be used to ...READ MORE

answered Dec 17, 2018 in Selenium by Vardhan
• 10,620 points
70 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.