StartPerformanceTransactionForApplication
Description
Start Performance Transaction collects data on Duration, CPU, Battery, Memory of the specified application on the device. The Network traffic will be measured for the device, and not per application.
The command must be used with EndPerformanceTransaction.
Parameters
Name | Value |
---|---|
applicationName | Application to be monitored (bundle id for iOS and package name for Android) |
NVProfile | Name of the Virtualization profile (Network Virtualization). If the empty value is passed, then the '3G-average' profile is selected and if 'NONE' value is passed, no profile will be selected. |
This will start a performance transaction. An exception is thrown if trying to start a transaction while an existing transaction is already run.
You can view the transaction, once ended, in Reporter under Transactions.
info
- Android 5.0+ and all iOS versions are supported.
- The maximum transaction maximum time is 5 minutes. After 5 minutes the transaction is canceled.
- The transaction will be canceled if you release the client or quit the driver. No data will be saved.
- Make sure the NV server is configured correctly and connected to Host Machine. The device must connect to the NV network. For more information see Network Virtualization Server.
info
Replace <server> with the appropriate URL.
- Public Continuous Testing Cloud - https://cloud.seetest.io/wd/hub/.
- Dedicated Continuous Testing Cloud environment - Your own domain. For example: https://company.experitest.com/wd/hub/
- On-premises Continuous Testing Cloud environment - Your designated URL. For example: https://company.com/wd/hub
Example
StartPerformanceTransaction
String accessKey = "<ACCESS_KEY>"
String url = "<server>";
DesiredCapabilities dc = new DesiredCapabilities();
//...your capabilities
dc.setCapability("testName", "Transaction example Demo");
dc.setCapability("accessKey", accessKey);
dc.setCapability("deviceQuery", "@os='android' and @category='TABLET'");
dc.setCapability(MobileCapabilityType.APP, "cloud:com.experitest.ExperiBank/.LoginActivity");
dc.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, "com.experitest.ExperiBank");
dc.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, ".LoginActivity");
driver = new AndroidDriver(new URL(url), dc);
seetest = new SeeTestClient(driver);
dc.setCapability(MobileCapabilityType.UDID, "deviceid");
...
...
// Starts performance transaction
seetest.startPerformanceTransactionForApplication("com.experitest.ExperiBank", "4G-average");
//do some work. For example - Login transaction:
driver.findElement(By.xpath("//*[@id='loginButton']")).click();
// end performance transaction, returns a performance data in JSON format.
String loginPerfData = seetest.endPerformanceTransaction("Login");