Pcloudy Mobile Commands

Prev Next

Overview
Use Appium Client methods to use pCloudy API's in automation scripts. By using the code mentioned below, users can send commands to the mobile devices used for automation testing. This will help users to use pCloudy features in their test automation to bring more values to functional tests.

Command
driver.executeScript("pCloudy_executeAdbCommand", "ADB_COMMAND");

Example
Object obj = driver.executeScript("pCloudy_executeAdbCommand", "adb devices"); System.out.println("@Output: " + obj);

Command
Map<String, Object> params = new HashMap<>();
params.put("latitude", "28.6139");
params.put("longitude", "77.2088");
Thread.sleep(20000);
System.out.println(driver.executeScript("pCloudy_setAndroidLocation",params));
Thread.sleep(20000);

Example
Map<String, Object> params = new HashMap<>();
params.put("latitude", "28.6139");
params.put("longitude", "77.2088");
Thread.sleep(20000);
System.out.println(driver.executeScript("pCloudy_setAndroidLocation",params));
Thread.sleep(20000);

Command
driver.executeScript("pCloudy_switchDeviceLocation", "true/false");

Example
Object obj1 = driver.executeScript("pCloudy_switchDeviceLocation", "true");

Command
driver.executeScript("pCloudy_enablewifi", "true/false");

Example
driver.executeScript("pCloudy_enablewifi", "true");

Command
Map<String, Object> params = new HashMap<>(); params.put("enableRecord", true); System.out.println(driver.executeScript("mobile:video:record",params));

Example
Map<String, Object> params = new HashMap<>(); params.put("enableRecord", true); System.out.println(driver.executeScript("mobile:video:record",params));

Command
Map<String, Object> params = new HashMap<>(); params.put("enableRecord", false); System.out.println(driver.executeScript("mobile:video:record",params));

Example
Map<String, Object> params = new HashMap<>(); params.put("enableRecord", false); System.out.println(driver.executeScript("mobile:video:record",params));

Command
driver.executeScript("pCloudy_getReportLink");

Example
String link = (String) driver.executeScript("pCloudy_getReportLink"); System.out.println(link);

Command
Map<String, Object> params = new HashMap<>(); params.put("getDeviceUrl", true); System.out.println(driver.executeScript("mobile:device:url",params));

Example
Map<String, Object> params = new HashMap<>(); params.put("getDeviceUrl", true); System.out.println(driver.executeScript("mobile:device:url",params));

Command
Map<String, Object> params = new HashMap<>(); params.put("auth", true); System.out.println(driver.executeScript("mobile:fingerprint:auth",params));

Example
Map<String, Object> params = new HashMap<>(); params.put("auth", true); System.out.println(driver.executeScript("mobile:fingerprint:auth",params));

Command
Map<String, Object> params = new HashMap<>(); params.put("auth", true); System.out.println(driver.executeScript("mobile:biometric:auth",params));

Example
Map<String, Object> params = new HashMap<>(); params.put("auth", true); System.out.println(driver.executeScript("mobile:biometric:auth",params));

Command
"Map<String, Object> params = new HashMap<>();
params.put(""image"", ""QR_code_G.png"");
Thread.sleep(2000);
System.out.println(driver.executeScript(""pCloudy_injectImage"",params));
Thread.sleep(2000"

Example
"Map<String, Object> params = new HashMap<>();
params.put(""image"", ""QR_code_G.png"");
Thread.sleep(2000);
System.out.println(driver.executeScript(""pCloudy_injectImage"",params));
Thread.sleep(2000);"

Note - User can get information about all the network profiles available according to that user can simulate the network.
.
Command
Map<String, Object> params = new HashMap<>(); params.put("profileName", "4G-LTE-Advanced"); System.out.println(driver.executeScript("mobile:network:start",params));

Example
Map<String, Object> params = new HashMap<>(); params.put("profileName", "4G-LTE-Advanced"); System.out.println(driver.executeScript("mobile:network:start",params));

Command
Map<String, Object> params = new HashMap<>(); params.put("profileName", "4G-LTE-Advanced"); System.out.println(driver.executeScript("mobile:network:stop",params));

Example
Map<String, Object> params = new HashMap<>(); params.put("profileName", "4G-LTE-Advanced"); System.out.println(driver.executeScript("mobile:network:stop",params));

Command
Map<String, Object> params = new HashMap<>(); driver.executeScript("mobile:ocr:text",params);

Command
Map<String, Object> params = new HashMap<>(); params.put("baseImageId", "firstImageId"); params.put("secondImageId", "secondImageId"); driver.executeScript("mobile:visual:imageDiff",params);

Command
Map<String, Object> params = new HashMap<>(); params.put("imageId", "ID"); params.put("word", "abc"); System.out.println(driver.executeScript("mobile:ocr:textExists",params));

Command
Map<String, Object> params = new HashMap<>(); params.put("imageId", "ID"); params.put("word", "abc"); System.out.println(driver.executeScript("mobile:ocr:coordinate",params));

Command
Map<String, Object> params = new HashMap<>(); params.put("transactionName", "Name of transaction file"); params.put("enableHar", true); params.put("harFileName", "Har file Name"); driver.executeScript("mobile:transaction:start",params);

Command
Map<String, Object> params = new HashMap<>(); driver.executeScript("mobile:transaction:stop",params);

Command
Map<String, Object> params = new HashMap<>(); params.put("orientation", "L"); System.out.println(driver.executeScript("mobile:device:rotate",params));

Command
Map<String, Object> params1 = new HashMap<>(); params1.put("orientation", "P"); System.out.println(driver.executeScript("mobile:device:rotate",params1));

Command
"Map<String, Object> params = new HashMap<>();
params.put(""name"", ""com.pcloudy.appiumdemo"");
Thread.sleep(3000);
System.out.println(driver.executeScript(""mobile:application:close"",params));
Thread.sleep(3000);"

Example
"Map<String, Object> params = new HashMap<>();
params.put(""name"", ""com.pcloudy.appiumdemo"");
Thread.sleep(3000);
System.out.println(driver.executeScript(""mobile:application:close"",params));
Thread.sleep(3000);"

Command
"Map<String, Object> params1 = new HashMap<>();
params.put(""name"", ""com.pcloudy.appiumdemo"");
params.put(""fileName"", ""pCloudyAppiumDemo-1682759228.apk"");
Thread.sleep(3000);
System.out.println(driver.executeScript(""mobile:application:open"",params));
Thread.sleep(3000);"

Example
"Map<String, Object> params1 = new HashMap<>();
params.put(""name"", ""com.pcloudy.appiumdemo"");
params.put(""fileName"", ""pCloudyAppiumDemo-1682759228.apk"");
Thread.sleep(3000);
System.out.println(driver.executeScript(""mobile:application:open"",params));
Thread.sleep(3000);"

Command
"Map<String, Object> params = new HashMap<>();
params.put(""name"",""xyz"");
params.put(""phone"",""123567890"");
params.put(""email"",""proxy@gmail.com"");
System.out.println(driver.executeScript(""mobile:createContact"",params));
Thread.sleep(10000);"

Example
"Map<String, Object> params = new HashMap<>();
params.put(""name"",""xyz"");
params.put(""phone"",""1234567890"");
params.put(""email"",""proxy@gmail.com"");
System.out.println(driver.executeScript(""mobile:createContact"",params));
Thread.sleep(10000);"

Command
"Map<String, Object> params = new HashMap<>();
params.put(""location"", ""140,640,0,0"");
Thread.sleep(2000);
System.out.println(driver.executeScript(""mobile:touch:tap"",params));
Thread.sleep(2000);"

Example
"Map<String, Object> params = new HashMap<>();
params.put(""location"", ""140,640,0,0"");
Thread.sleep(2000);
System.out.println(driver.executeScript(""mobile:touch:tap"",params));
Thread.sleep(2000);"

Command
"Map<String, Object> params = new HashMap<>();
params.put(""text"", ""Hello Bangalore"");
Thread.sleep(1000);
System.out.println(driver.executeScript(""mobile:typetext"",params));
Thread.sleep(2000);"

Example
"Map<String, Object> params = new HashMap<>();
params.put(""text"", ""Hello Bangalore"");
Thread.sleep(1000);
System.out.println(driver.executeScript(""mobile:typetext"",params));
Thread.sleep(2000);"

Command
"Object obj1 = driver.executeScript(""pCloudy_biometric"", true/false);
Thread.sleep(5000);
System.out.println(""@Output: "" + obj1);
Thread.sleep(5000);"

Example
"Object obj1 = driver.executeScript(""pCloudy_biometric"", true/false);
Thread.sleep(5000);
System.out.println(""@Output: "" + obj1);
Thread.sleep(5000);"