Skip to main content

StartPerformanceTransaction

Description

Use this command to collect data on Duration, CPU, Battery, Memory, and Network traffic of the device.

The command must be used with EndPerformanceTransaction.

warning

Network traffic (HAR) will not be recorded in the transaction if tunneling is turned on.

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 the Reporter under Transactions.

info
  • This is supported on Android 5.0+ and all iOS versions.
  • The transaction maximum time is 5 min. After 5 minutes the transaction is canceled.
  • The transaction is canceled if you release 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 should be connected to the NV network. For more information see Network Virtualization Server.

Parameters

NameValue
NVProfileName of the Virtualization profile (Network Virtualization).



If no value is passed, '3G-average' is used.



If 'NONE' is passed, no profile is used.

Usage

info

Replace <ACCESS_KEY> with the appropriate access key.

info

Replace <server> with the appropriate URL.

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.startPerformanceTransaction("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");