NativeScript / nativescript-background-http

Background Upload plugin for the NativeScript framework
Apache License 2.0
102 stars 50 forks source link

"Android: null" printed when tried to launch device in @BeforeClass but Same code is working fine in Main as a separate class #125

Closed Ravicmeti closed 6 years ago

Ravicmeti commented 6 years ago
@BeforeClass
    public void MobileTestLaunch() {

        /*driver = Utility.getDriver();
        System.out.println(driver);*/
        String path;    
        System.out.println("Session is creating");
        path = System.getProperty("user.dir");
        DesiredCapabilities cap = new DesiredCapabilities();
        cap.setCapability("platformName", "Android");
        cap.setCapability("deviceName", "Fieldez(SM-T311)");
        cap.setCapability("app", path+"//app//fieldEZ1.apk");
        try {
            driver = new AndroidDriver<MobileElement>(new URL("http://127.0.0.1:4723/wd/hub"), cap);
            System.out.println(driver); // printing Android: null here
        } catch (MalformedURLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
        System.out.println("Session is created");
    }
NickIliev commented 6 years ago

@Ravicmeti not exactly sure how the above code is connected to nativescript-backghrouind-http plugin - please elaborate more.