RE: Need to Update on Practice Exercise 1


Need to update Practice Exercise 1 codes on this linkĀ

Updated working code:

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;

public class exercise1 {

private static WebDriver driver = null;

public static void main(String[] args) {

driver = new FirefoxDriver();

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);


//Here we are storing the value from the cell in to the string variable

String sCellValue = driver.findElement(By.xpath(“.//*[@id=’content’]/table/tbody/tr[1]/td[2]”)).getText();


// Here we are clicking on the link of first row and the last column


System.out.println(“Link has been clicked otherwise an exception would have thrown”);




jctantiado Default Asked on March 30, 2015 in Selenium WebDriver.

It differs on the given xpath value. Thanks

on March 30, 2015.
Add Comment
2 Answers

Thanks for the updated code, we will soon update your code on the website.

Thanks for your help!!


Professor Answered on March 30, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.