0 votes
in Selenium by
How to click on a hyperlink in Selenium?

1 Answer

0 votes
by

driver.findElement(By.linkText(“Today’s deals”)).click();

The command finds the element using link text and then clicks on that element, where after the user would be redirected to the corresponding page.

driver.findElement(By.partialLinkText(“Service”)).click();

The above command finds the element based on the substring of the link provided in the parenthesis and thus partialLinkText() finds the web element. 

Related questions

0 votes
asked Aug 19, 2019 in Selenium by rahulsharma
0 votes
asked Aug 19, 2019 in Selenium by rahulsharma
...