This is the error I am getting
FAILED CONFIGURATION: @BeforeTest beforetest
java.lang.NullPointerException
This is my Config reader class to load my property file
public static void Configreader() {
try {
File src = new File("./src/test/resources/config.properties");
FileInputStream fis = new FileInputStream(src);
pro = new Properties();
pro.load(fis);
System.out.println("Property class loaded");
} catch (Exception e) {
System.out.println("Exception is" +e.getMessage());
}
}
This is my test class where i want to access my webelements
public class LoanDetails extends Configreader {
static Properties pro;
WebDriver driver;
@BeforeTest
public void beforetest() throws Exception {
Configreader();
driver = Browser.GetBrowser();
System.out.println(" value is " +pro.getProperty("account_xpath"));
}
}
i need to access my webelement ("account_xpath") otherwise everything is working
i have attached my property file below where i need to acess my webelement (account_xpath)