Automation Question: Download Questions PDF
Do you know how to locate a link using its text in Selenium?
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”));
The examples:
WebElement link1 = driver.findElement(By.linkText(“some_link_test”));
WebElement link2 = driver.findElement(By.partialLinkText(“some_link_part_text”));
Download Automation Interview Questions And Answers
PDF
Previous Question | Next Question |
Tell us what kind of keyboard operations can be performed in Selenium? | Tell us what methods of Robot Class do you know? |