I’m running some of my cases which are written in c# under .net platform on a real time which is attached to my workstation.
Below is my code and it works fine.

  public void AppiumSetupMethod()
        {

            string appPath = @"G:ProjectsUGLDTZMobilityMobility.clientreleaseandroiddev-2.1_.apk";
            DesiredCapabilities capabilities = new DesiredCapabilities();
            capabilities.SetCapability(CapabilityType.BrowserName, "");
            capabilities.SetCapability(CapabilityType.Platform, "Android");
           capabilities.SetCapability(CapabilityType.Version, "4.1.0");
            capabilities.SetCapability(CapabilityType.IsJavaScriptEnabled, "true");

            capabilities.SetCapability("deviceName", "CB5A1THVTT");

            capabilities.SetCapability("appActivity", "com.XXX.XXX.XXX");

            capabilities.SetCapability("Version", "4.1.0");
            capabilities.SetCapability("platformName", "Android");
            capabilities.SetCapability("autoWebview", "true");
            capabilities.SetCapability("sessionOverride", "true");
            capabilities.SetCapability("app", appPath);
            capabilities.SetCapability("appPackage", "com.XX.XX");

            capabilities.SetCapability("newCommandTimeout", "0");
            capabilities.SetCapability("recreateChromeDriverSessions", "true");


            driver = new AndroidDriver <IWebElement> (new Uri("http://127.0.0.1:4723/wd/hub"), capabilities,TimeSpan.FromSeconds(180));
            Thread.Sleep(15000);
        }

But how should i run the same test on a device.
According to kobiton’s documentation i have did some initial setup, as below,
But i don’t know how to add the kobitonServerUrl.

public void kobitonSetupMethod()
    {
        String kobitonServerUrl = "https://chathudagr8:[email protected]/wd/hub";
        string appPath = @"G:ProjectsUGLDTZMobilityMobility.clientreleaseandroiddev-2.1_.apk";

        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.SetCapability("sessionName", "Automation test session");
        capabilities.SetCapability("sessionDescription", "");
        capabilities.SetCapability("deviceOrientation", "portrait");
        capabilities.SetCapability("captureScreenshots", true);
        // The maximum size of application is 500MB
        // By default, HTTP requests from  library are expired
        // in 2 minutes while the app copying and installation may
        // take up-to 30 minutes. Therefore, you need to extend the HTTP
        // request timeout duration in your  library so that
        // it doesn't interrupt while the device is being initialized.
        capabilities.SetCapability("app",appPath);
        capabilities.SetCapability("deviceGroup", "KOBITON");
        capabilities.SetCapability("deviceName", "Galaxy On Nxt");
        capabilities.SetCapability("platformVersion", "6.0.1");
        capabilities.SetCapability("platformName", "Android");




        capabilities.SetCapability(CapabilityType.IsJavaScriptEnabled, "true");
        capabilities.SetCapability("appActivity", "com.XX.XX.XXX");
        capabilities.SetCapability("autoWebview", "true");
        capabilities.SetCapability("sessionOverride", "true");
        capabilities.SetCapability("appPackage", "com.XXX.XXX");
        //capabilities.SetCapability("appPackage", "com.dtz");
        capabilities.SetCapability("newCommandTimeout", "0");
        capabilities.SetCapability("recreateChromeDriverSessions", "true");
        driver = new AndroidDriver<IWebElement>(new Uri("http://127.0.0.1:4723/wd/hub"), capabilities, TimeSpan.FromSeconds(180));
        Thread.Sleep(15000);
    }



Source link https://sqa.stackexchange.com/questions/32276/-appium-test-on-kobiton-device

LEAVE A REPLY

Please enter your comment!
Please enter your name here