-2

I getting null value from web element object in code below.

Im currently getting a null pointer exception error.

WebElement element = null;
String locatorVal = "userId";
element = Constant.driver.findElement(By.id(locatorVal));
RamenChef
  • 5,557
  • 11
  • 31
  • 43

1 Answers1

0

probably you should change code as below. Or share more info

element = driver.findElement(By.id(locatorVal));
Giri
  • 411
  • 2
  • 18