Automation with SeeTest Cloud

image2016-3-15 12_13_22

     From my experience with automation execution on Cloud tools, I had done the executions with Perfecto Cloud, Sauce Labs, Browserstack; now am with SeeTest Cloud. In SeeTest Cloud, easily run your Selenium and Appium tests against real iOS, Android & desktop browsers, ensuring that you are testing real user scenarios accurately.

       Start testing mobile and web applications on the cloud. It will support both manual and automation tests. Allows you to easily create automated tests for your mobile application using our large selection of real iOS and Android.

     Here I would like to share what are the capabilities required to execute your automation scripts in SeeTest Cloud for Mobile Native (iOS and Android), Mobile Web (iOS and Android) and Desktop Browsers. Before start setup the capabilities and script execution, you need a account in SeeTest Cloud. For the account, you need to register with SeeTest Cloud (https://cloud.seetest.io/) and get the access key, specify the access key in the set of test capabilities to gain access to remote testing. Once the access key ready, you can set the Desired Capabilities and instantiate the driver for Automation scripts. Following steps helps to get the access key from your registered SeeTest Cloud account,

In the cloud, click on your profile → Get Access Key

Capture.PNG

For Mobile Native - Android

AndroidDriver driver = null;
DesiredCapabilities dc = new DesiredCapabilities(); 
dc.setCapability("testName", "Android Mobile Native Test Execution"); 
dc.setCapability("accessKey", "your_SeeTest_acess_key");
dc.setCapability("deviceQuery", "@os='android'"); 
dc.setCapability("deviceModel", "device_name"); 
dc.setCapability(MobileCapabilityType.PLATFORM_VERSION, "device OS_version"); 
dc.setCapability(MobileCapabilityType.UDID, "device_UDID"); 
dc.setCapability(MobileCapabilityType.APP, "application_location_in_SeeTest"); 
dc.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, "application_package_name"); 
dc.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, "application_activity_name"); 
driver = new AndroidDriver<>(new URL("https://cloud.seetest.io/wd/hub"), dc);
For Mobile Native - iOS

IOSDriver driver = null;
DesiredCapabilities dc = new DesiredCapabilities(); 
dc.setCapability("testName", "iOS Mobile Native Test Execution");
dc.setCapability("accessKey", "your_SeeTest_acess_key");
dc.setCapability("deviceQuery", "@os='ios'"); 
dc.setCapability("deviceModel", "device_name"); 
dc.setCapability(MobileCapabilityType.PLATFORM_VERSION, "device_OS_version"); 
dc.setCapability(MobileCapabilityType.UDID, "device_UDID"); 
dc.setCapability(MobileCapabilityType.APP, "application_location_in_SeeTest Cloud"); 
dc.setCapability(IOSMobileCapabilityType.BUNDLE_ID, "Bundle_ID of the application");
driver = new IOSDriver<>(new URL("https://cloud.seetest.io/wd/hub"), dc);
For Mobile Web - Android

AndroidDriver driver = null;
DesiredCapabilities dc = new DesiredCapabilities(); 
dc.setCapability("testName", "Android Mobile Web Test Execution");
dc.setCapability("accessKey", "your_SeeTest_acess_key");
dc.setCapability("deviceQuery", "@os='android'"); 
dc.setCapability("deviceModel", "device_name"); 
dc.setCapability(MobileCapabilityType.PLATFORM_VERSION, "device_OS_version"); 
dc.setCapability(MobileCapabilityType.UDID, "device_UDID"); 
dc.setBrowserName(MobileBrowserType.CHROMIUM);
driver = new AndroidDriver<>(new URL("https://cloud.seetest.io/wd/hub"), dc);
For Mobile Web- iOS

IOSDriver driver = null;
DesiredCapabilities dc = new DesiredCapabilities();
dc.setCapability("testName", "iOS Mobile Web Test Execution");
dc.setCapability("accessKey", "your_SeeTest_acess_key");
dc.setCapability("deviceQuery", "@os='ios'");
dc.setCapability("deviceModel", "device_name");
dc.setCapability(MobileCapabilityType.PLATFORM_VERSION, "selected_device_OS_version");
dc.setCapability(MobileCapabilityType.UDID, "device_UDID");
dc.setBrowserName(MobileBrowserType.SAFARI);
driver = new IOSDriver<>(new URL("https://cloud.seetest.io/wd/hub"), dc);
For Desktop Web

WebDriver driver;
DesiredCapabilities dc = new DesiredCapabilities();
dc.setCapability("testName", "Desktop Web Test Execution");
dc.setCapability("accessKey", "your_SeeTest_acess_key");
dc.setCapability(CapabilityType.PLATFORM, "desktop_OS_name"); 
dc.setCapability(CapabilityType.BROWSER_NAME, "name of the browser"); 
dc.setCapability(CapabilityType.VERSION, "browser_version");
driver = new RemoteWebDriver(new URL("https://cloud.seetest.io/wd/hub"), dc);

Now, the capabilities and driver is ready, next you can start writing your automation scripts and execute it on SeeTest Cloud.

make it perfect !

 

Appium Desired Capabilities for Android and iOS

Screen-Shot-2016-09-28-at-11.03.39-AM

     Most of the time I observed that people facing the issues at the initial stage of running their automation scripts due to lack of knowledge in the selection of Desired Capabilities based on their Automation platform. Here, I would like to explain important Desired Capabilities for following:

  • Mobile Web Android
  • Mobile Web iOS
  • Mobile Native Android
  • Mobile Native iOS

Mobile Web Android
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, “Android”);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, “name of your test device”);
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, “OS version of your test device”);
capabilities.setCapability(“udid”, “UDID of your test device”);
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, “Chrome”);

Mobile Web iOS
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, “iOS”);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, “name of your test device”);
capabilities.setCapability(“udid”, “UDID of your test device”);
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, MobileBrowserType.SAFARI);
capabilities.setCapability(nativeWebTap, true);
capabilities.setCapability(“startIWDP”, true);
capabilities.setCapability(IOSMobileCapabilityType.START_IWDP, true);
capabilities.setCapability(“app”, “path of SAFAILAUNCHERAPPPATH”);
//SAFAILAUNCHERAPPPATH = “/usr/local/lib/node_modules/appium/node_modules/appium-ios-driver/build/SafariLauncher/SafariLauncher.app”
capabilities.setCapability(“automationName”, “XCUITest”);
capabilities.setCapability(“realDeviceLogger”, “path of DEVICECONSOLEPATH”);
//DEVICECONSOLEPATH=”/usr/local/lib/node_modules/deviceconsole/deviceconsole”

Mobile Native Android
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, “Android”);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, “name of your test device”);
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, “OS version of your test device”);
capabilities.setCapability(MobileCapabilityType.UDID, “UDID of your test device”);
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.ANDROID_UIAUTOMATOR2);
capabilities.setCapability(MobileCapabilityType.APP, “location of your .APK”);
capabilities.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, “package name of your Android application”);
capabilities.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, “activity name of your Android application”);

Mobile Native iOS
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, “iOS”);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, “name of your test device”);
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, “OS version of your test device”);
capabilities.setCapability(MobileCapabilityType.UDID, “UDID of your test device”);
capabilities.setCapability(MobileCapabilityType.APP, “location of your .iPA or .APP”);
capabilities.setCapability(IOSMobileCapabilityType.BUNDLE_ID, “bundle ID of your iOS application”);
capabilities.setCapability(“automationName”, “XCUITest”);
capabilities.setCapability(“realDeviceLogger”, “path of DEVICECONSOLEPATH”);
//DEVICECONSOLEPATH=”/usr/local/lib/node_modules/deviceconsole/deviceconsole”

     Once you set your Desired Capabilities, next need to instantiate the drivers for Android and iOS in the following way:

For Android
WebDriver driver;
driver = new AndroidDriver(new URL(“http://127.0.0.1:4723/wd/hub&#8221;), capabilities)

For iOS
WebDriver driver;
driver = new IOSDriver(new URL(“http://127.0.0.1:4723/wd/hub&#8221;), capabilities)

Try to use above mentioned Desired Capabilities in your automation scripts.

make it perfect !