Log in
updated 11:29 AM UTC, May 4, 2016

How to find a link element using selenium

  • Written by Madhu V Rao
  • Published in Automation

Here is a small code snippet to find link element using complete name or partial name


	public WebElement link(String label) {
		WebElement we = this.we.findElement(By.linkText(label));
		return we;

	public WebElement linkPartial(String label) {
		WebElement we = this.we.findElement(By.partialLinkText(label));
		return we;

this.we = this.driver.findElement(By.tagName("body"))

Powered by Bullraider.com
Follow Us on Twitter
Find Us on Facebook
Follow Us on Google
Follow Us on Pinterest