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
• 3,030 points
3,527 views

1 answer to this question.

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

+1 vote
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,890 points
4,677 views
+2 votes
1 answer
0 votes
2 answers

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,520 points
4,630 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,010 points
5,476 views
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,890 points
3,303 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 2, 2020 in Selenium by Sri
• 3,010 points
3,905 views
0 votes
8 answers

How to open a link in new tab of chrome browser using Selenium WebDriver?

This below code works for me in ...READ MORE

answered Dec 13, 2020 in Selenium by Gitika
• 65,870 points
60,799 views
+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
• 13,200 points
9,252 views