Category Page

Struggling with your Appium test automation?

 

The much awaited bonanza for Appium users is here. We are up with a newer and simpler Appium integration architecture which can simplify your Appium test automation execution on Android and iOS devices with pCloudy. The newer architecture make developers’ life simpler with lesser changes in the code. The older architecture demanded using APIs and also changes in your code that required some level of expertise. We addressed this issue and have come up with a simpler architecture where you need to mention some desired capabilities instead of calling APIs or doing changes in the code to run the Appium scripts. And wonder what! it makes you save 50% of your app testing time.

 

Watch the video to know more about the new simpler and faster pCloudy Appium architecture.

Pre-requisites

  • Appium Script
  • APK or IPA file
  • pCloudy Account

The basic steps to replace your local Appium driver to pCloudy Appium Driver are given below:

  • Upload the apk/ipa from your local system to pCloudy. Check this link to know steps to upload an app for test.
  • Set pCloudy capabilities
    • pCloudy_Username: Enter the email ID with which you have registered on pCloudy. For reference, check this link

      Example: capabilities.setCapability(“pCloudy_Username”, ‘{e-mail-id}’);

    •  

    • pCloudy_ApiKey: API key is important for user’s verification. You can generate the API key from Settings page on device.pcloudy.com. Check this link to get your API key.

      Example: capabilities.setCapability(“pCloudy_ApiKey”, “{api-key}”);

    •  

    • pCloudy_ApplicationName: Enter the application name for the apk/ipa file which you already uploaded in the MyApp/Data.

      Example: capabilities.setCapability(“pCloudy_ApplicationName”, “pCloudyAppiumDemo.apk”);

    •  

    • pCloudy_DurationInMinutes: Enter the duration in minutes for which you want to run the test.

      Example: capabilities.setCapability(“pCloudy_DurationInMinutes”, 5);

    •  

    • pCloudy_DeviceFullName: If you know the device manufacturer, device name and version then enter the full device name.

      Example: capabilities.setCapability(“pCloudy_DeviceFullName”, “Samsung_GalaxyTabA_Android_7.1.1”);

      Note: If you don’t know the Device full name then you can enter pCloudy_DeviceManufacturer and pCloudy_DeviceVersion in the code and it will automatically run command on those devices.

      Example: capabilities.setCapability(“pCloudy_DeviceManafacturer”, “Samsung”);

      capabilities.setCapability(“pCloudy_DeviceVersion”, “5.0.1”);

    •  

  • Use pCloudy Appium endpoint as ” https://device.pcloudy.com/appiumcloud/wd/hub “
  • Create the Appium driver object and perform the execution

Device capabilities and code snippets to run Appium on Single Android Native App:

 

@BeforeMethod
public void prepareTest() throws IOException, InterruptedException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“pCloudy_Username”, “Enter your email Id”);
capabilities.setCapability(“pCloudy_ApiKey”, “Enter your API Key”);
capabilities.setCapability(“pCloudy_ApplicationName”, “pCloudyAppiumDemo.apk”);
capabilities.setCapability(“pCloudy_DurationInMinutes”, 5);
capabilities.setCapability(“pCloudy_DeviceFullName”, “Samsung_GalaxyTabA_Android_7.1.1”);
driver = new AndroidDriver(new URL(“https://device.pcloudy.com/appiumcloud/wd/hub”), capabilities);
}
Note: Capabilities mentioned below are optional:
capabilities.setCapability(“pCloudy_DeviceManafacturer”, “Samsung”);
capabilities.setCapability(“pCloudy_DeviceVersion”, “5.0.1”);

Appium Integration Architecture


Device capabilities and code snippets to run Appium on Multiple Android Native Apps:

 

@Parameters({ “deviceName” })
@BeforeMethod
public void prepareTest(String deviceName) throws IOException, InterruptedException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“pCloudy_Username”, “Enter your email Id”);
capabilities.setCapability(“pCloudy_ApiKey”, “Enter your API Key”);
capabilities.setCapability(“pCloudy_ApplicationName”, “pCloudyAppiumDemo.apk”);
capabilities.setCapability(“pCloudy_DurationInMinutes”, 5);
capabilities.setCapability(“pCloudy_DeviceManafacturer”, deviceName);
driver = new AndroidDriver(new URL(“https://device.pcloudy.com/appiumcloud/wd/hub”), capabilities);
}
Note: Capabilities mentioned below are optional:
capabilities.setCapability(“pCloudy_DeviceVersion”, “5.0.1”);
capabilities.setCapability(“pCloudy_DeviceFullName”, “Samsung_GalaxyTabA_Android_7.1.1”);

Code 2


Device capabilities and code snippets to run Appium on Single iOS Native Apps:

 

@BeforeMethod
public void prepareTest() throws IOException, InterruptedException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“pCloudy_Username”, “Enter your email Id”);
capabilities.setCapability(“pCloudy_ApiKey”, “Enter your API Key”);
capabilities.setCapability(“pCloudy_ApplicationName”, “TestmunkDemo.ipa”);
capabilities.setCapability(“pCloudy_DurationInMinutes”, 5);
capabilities.setCapability(“pCloudy_DeviceFullName”, “Apple_iPhone6S_Ios_11.2.0”);
driver = new IOSDriver(new URL(“https://device.pcloudy.com/appiumcloud/wd/hub”), capabilities);
}
Note: Capabilities mentioned below are optional:
capabilities.setCapability(“pCloudy_DeviceManafacturer”, “Apple”);
capabilities.setCapability(“pCloudy_DeviceVersion”, “10.3.2”);

Code 3


Device capabilities and code snippets to run Appium on Multiple iOS Native Apps:

 

@Parameters({ “deviceName” })
@BeforeMethod
public void prepareTest(String deviceName) throws IOException, InterruptedException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“pCloudy_Username”, “Enter your email-id”);
capabilities.setCapability(“pCloudy_ApiKey”, “Enter your APIKey”);
capabilities.setCapability(“pCloudy_ApplicationName”, “TestmunkDemo.ipa”);
capabilities.setCapability(“pCloudy_DurationInMinutes”, 5);
capabilities.setCapability(“pCloudy_DeviceManafacturer”, deviceName);
driver = new IOSDriver(new URL(“https://device.pcloudy.com/appiumcloud/wd/hub”), capabilities);
}
Note: Capabilities mentioned below are optional:
capabilities.setCapability(“pCloudy_DeviceVersion”, “10.3.2”);
capabilities.setCapability(“pCloudy_DeviceFullName”, “Apple_iPhone6S_Ios_11.2.0”);

Code 4


Device capabilities and code snippets to run on Single iOS-Browser App:

 

@BeforeMethod
public void prepareTest() throws IOException, InterruptedException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“pCloudy_Username”, “Enter your email-id”);
capabilities.setCapability(“pCloudy_ApiKey”, “Enter your APIKey”);
capabilities.setCapability(“pCloudy_DurationInMinutes”, 5);
capabilities.setCapability(“pCloudy_DeviceFullName”, “Apple_iPhone6S_Ios_11.2.0”);
capabilities.setBrowserName(“Safari”);
driver = new IOSDriver(new URL(“https://device.pcloudy.com/appiumcloud/wd/hub”), capabilities);
}
Note: Capabilities mentioned below are optional:
capabilities.setCapability(“pCloudy_DeviceManafacturer”, “Apple”);
capabilities.setCapability(“pCloudy_DeviceVersion”, “10.3.2”);

Code 5


Device capabilities and code snippets to run on Multiple iOS-Browser App:

 

@Parameters({ “deviceName” })
@BeforeMethod
public void prepareTest(String deviceName) throws IOException, InterruptedException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“pCloudy_Username”, “Enter your email-id”);
capabilities.setCapability(“pCloudy_ApiKey”, “Enter your APIKey”);
capabilities.setCapability(“pCloudy_DurationInMinutes”, 5);
capabilities.setCapability(“pCloudy_DeviceManafacturer”, deviceName);
capabilities.setBrowserName(“Safari”);
driver = new IOSDriver(new URL(“https://device.pcloudy.com/appiumcloud/wd/hub”), capabilities);
}
Note: Capabilities mentioned below are optional:
capabilities.setCapability(“pCloudy_DeviceVersion”, “10.3.2”);
capabilities.setCapability(“pCloudy_DeviceFullName”, “Apple_iPhone6S_Ios_11.2.0”);

Multiple Browser App


Device capabilities and code snippets to run on Single Android-Browser App:

 

@BeforeMethod
public void prepareTest() throws IOException, InterruptedException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“pCloudy_Username”, “Enter your email-id”);
capabilities.setCapability(“pCloudy_ApiKey”, “Enter your APIKey”);
capabilities.setCapability(“pCloudy_DurationInMinutes”, 5);
capabilities.setCapability(“pCloudy_DeviceManafacturer”, “Samsung”);
capabilities.setBrowserName(“Chrome”);
driver = new AndroidDriver(new URL(“https://device.pcloudy.com/appiumcloud/wd/hub”), capabilities);
}
Note: Capabilities mentioned below are optional:
capabilities.setCapability(“pCloudy_DeviceVersion”, “5.0.1”);
capabilities.setCapability(“pCloudy_DeviceFullName”, “Samsung_GalaxyTabA_Android_7.1.1”);

Single Android Browser App


Device capabilities and code snippets to run on Multiple Android-Browser Apps:

 

@Parameters({ “deviceName” })
@BeforeMethod
public void prepareTest(String deviceName) throws IOException, InterruptedException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“pCloudy_Username”, “Enter your email-id”);
capabilities.setCapability(“pCloudy_ApiKey”, “Enter your APIKey”);
capabilities.setCapability(“pCloudy_DurationInMinutes”, 5);
capabilities.setCapability(“pCloudy_DeviceManafacturer”, deviceName);
capabilities.setBrowserName(“Chrome”);
driver = new AndroidDriver(new URL(“https://device.pcloudy.com/appiumcloud/wd/hub”), capabilities);
}
Note: Capabilities mentioned below are optional:
capabilities.setCapability(“pCloudy_DeviceVersion”, “5.0.1”);
capabilities.setCapability(“pCloudy_DeviceFullName”, “Samsung_GalaxyTabA_Android_7.1.1”);

Multiple Android Browser App