0

I have test:

 @Test
 public void postStatusTest() {
 loginPage.logInFacebook("my-email", "my-password");
 facebookMainPage.checkNotifications();
 facebookMainPage.postStatus("Test");
 }

where:

  public FacebookMainPage checkNotifications(){
  if (driver.findElements(notificationsButton).size() > 0) driver.findElement(notificationButton).click();
  return new FacebookMainPage(driver);
  }

and:

 public FacebookMainPage postStatus(String statusText){
 driver.findElement(textField).click();
 driver.findElement(textField).sendKeys(statusText);
 driver.findElement(postButton).click();
 return new FacebookMainPage(driver);
 }

can you, please, explain why in my case both methods checkNotifications and postStatus return NullPointerException? I've read theory, but I hardly understand what in my case can be wrong.

SSD
  • 1,373
  • 2
  • 13
  • 20
president
  • 503
  • 1
  • 3
  • 18

0 Answers0