Automation Question: Download Automation PDF

Do you know how to locate a link using its text in Selenium?

Tweet Share WhatsApp

Answer:

linkText() and partialLinkText() are used for link location.

The examples:

WebElement link1 = driver.findElement(By.linkText(“some_link_test”));
WebElement link2 = driver.findElement(By.partialLinkText(“some_link_part_text”));

Download Automation PDF Read All 108 Automation Questions
Previous QuestionNext Question
Tell us what kind of keyboard operations can be performed in Selenium?Tell us what methods of Robot Class do you know?