Iam trying to create a POM project. Simple login to flipkart. But as soon as I run I get Null point exception. Somebody please help : Here's my project class files details:
public class Page { public static WebDriver driver = null; public static Properties Prop = null; public static Properties OR = null ;
public Page (){ /* System.out.println("xxxx1"); if (driver == null) System.out.println("xxxx1"); String ab = System.getProperty("user.dir");
System.out.println("xxxvvx1"+ab);
{*/ Prop = new Properties (); try { FileInputStream f = new FileInputStream(System.getProperty("user.dir")+"\\src\\Properties\\config.properties"); Prop.load(f); FileInputStream fs = new FileInputStream(System.getProperty("user.dir")+"\\src\\Properties\\OR.properties"); OR.load(fs); } catch (Exception e) { return; } // } System.out.println("xxxxm");
if (Prop.getProperty("browser").equals("Mozilla")) this.driver= new FirefoxDriver (); else if (Prop.getProperty("browser").equals("Chrome")) { this.driver= new ChromeDriver();
public class test { public static void main (String args[]){ loginPage l = new loginPage (); LandingPage LP = l.dologin("unnati.swami@gmail.com" ,"8861645276"); System.out.println("xxxx5");