Error ScreenshotGetting Null pointer exception after login....need to click on a button after login.
I created a login class and passed it's driver to this class in before test method. Now when it goes to @Test method ...It throws an exception of Null Pointer.
Previously when I was using extend method it was working fine.
@Test(priority =1)
public void clickaddbutton2() {
WebDriverWait wait=new WebDriverWait(driver, 20);
WebElement addprojectbutton;
addprojectbutton = wait.until(ExpectedConditions.elementToBeClickable(By.xpath( "html/body/app-root/app-home/div/div/main/div[3]/div[1]/a/button")));
addprojectbutton.click();
String project_infurl = driver.getCurrentUrl();
System.out.println("This is the url : " + project_infurl);
Assert.assertEquals(project_infurl, "http://192.168.1.82:8787/project-information");
}
@BeforeTest
public void beforeClass() throws Throwable {
LoginPage obj_login = new LoginPage(driver);
obj_login.setUp();
obj_login.verifyHomePageTitle();
}