In the following program I have missed a statement purposefully which could cause exception. Review the program, identify the exception, and share your comments or observations below. Click the “Click for solution” button to view the explanation of the output.
package tests;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.testng.annotations.Test;
public class SampleProgram13 {
@Test
public void testMySkills() {
WebDriver driver=null;
try {
driver.findElement(By.id("username")).sendKeys("admin");
} catch (Exception ex) {
System.out.println(ex.getMessage());
}
}
}