NullPointerException

20 views
Skip to first unread message

Chaithanya Vallabhaneni

unread,
Jul 16, 2024, 11:06:28 AM (11 days ago) Jul 16
to Selenium Users
public class FunctionalityOfLoginPage {
public WebDriver driver = new ChromeDriver();;
public loginPage login;
public WebDriverWait wait;

@BeforeMethod
public void setup(){
WebDriverManager.chromedriver().setup();


login = new loginPage(driver);
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));
wait = new WebDriverWait(driver,Duration.ofSeconds(5));
}

@Given("I am on the movie app login page")
public void navigateToUrl(){
driver.get("https://qamoviesapp.ccbp.tech");
}









java.lang.NullPointerException: Cannot invoke "org.pages.loginPage.areInputEmpty()" because "this.login" is null

at org.example.FunctionalityOfLoginPage.validPassword(FunctionalityOfLoginPage.java:74)
at ✽.I enter valid username and invalid password,I click on the login button(file:///C:/Users/HP/IdeaProjects/MoviesAppTest/src/test/resources/feature/LoginPage.feature:15)

Reply all
Reply to author
Forward
0 new messages