Selenium webdriver - How to get inner text of the cell of a html table

package selenium_examples;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Example {
 public static void main(String[] args)

  WebDriver driver = new FirefoxDriver();
  String text=driver.findElement(By.xpath("//table/tbody/tr[3]/td[2]")).getText();

Output:- Jackson
Above script gets 3rd row,2nd column cell text from below shown table.

working with webtables selenium webdriver

No comments:

Related Posts Plugin for WordPress, Blogger...