Hire QA – Specialized in QA Recruitment, Technical Interviews and Testing Solutions

How to get an attribute value of an element in Selenium Webdriver?

Category: Selenium WebDriver
// identify element
WebElement l=driver.findElement(By.className("fb_logo _8ilh img"));
  // getAttribute() to get src value
  String value = l.getAttribute("src");
  System.out.println("Src attribute is: "+ value);

Leave a Reply

Your email address will not be published. Required fields are marked *