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,020 points
3,024 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,246 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
3,827 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

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

answered Aug 31 in Selenium by Sri
• 2,970 points
4,807 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
2,773 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 in Selenium by Sri
• 2,970 points
3,149 views
0 votes
7 answers

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

Try this once driver.findElement(By.id("id")).sendKeys(Keys.CONT ...READ MORE

answered Sep 5 in Selenium by Sri
• 2,970 points
49,680 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,180 points
7,403 views