How to use partial link text in selenium

0 votes
What is the difference between Link text and Partial Link text and how to use Partial link text?
Dec 21, 2018 in Selenium by Jino
• 5,820 points
1,775 views

1 answer to this question.

0 votes

Okay so talking about 

LinkText: You need to mention the complete Link Text to access the element.

PartialLinkText: You just have to type the part of the text you know and the rest is taken care by Selenium.

The format for both are same 

driver.get("https://www.wikipedia.org/");

driver.findElement(By.partialLinkText("Foundation")).click();

The complete link text was Wikipedia Foundation so I just metioned Foundation and it works. This way, you can use Partial LinkText in Selenium.

Hey @Jino hope this helps.

answered Dec 21, 2018 by Nabarupa

Related Questions In Selenium

0 votes
2 answers

How to use link as a locator to find element in selenium?

driver.findElement(By.linkText("link")).click(); READ MORE

answered Sep 4, 2020 in Selenium by Sri
• 3,190 points
1,758 views
0 votes
1 answer

How to use Actions class in Selenium Webdriver?

In seleniun webdriver it is not mandatory ...READ MORE

answered Apr 4, 2018 in Selenium by Damon Salvatore
• 5,980 points
4,076 views
0 votes
5 answers

How to use JavaScript in selenium to click an Element?

WebElement element = driver.findElement(By.id("id")); JavascriptExe ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
70,364 views
0 votes
1 answer

How to use Enter/Return Key in Selenium

You can use the below code: import org.openqa.selenium.Keys WebEle ...READ MORE

answered Apr 18, 2018 in Selenium by Meci Matt
• 9,460 points
2,872 views
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,500 points
13,674 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,190 points
9,143 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,910 points
7,221 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 3, 2020 in Selenium by Sri
• 3,190 points
7,875 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 14, 2020 in Selenium by Gitika
• 65,770 points
103,026 views
0 votes
1 answer

How to use keyboard shortcuts in selenium?

Yes, you can use all the keyboard ...READ MORE

answered Dec 25, 2018 in Selenium by Shuvodip
19,183 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP