EndPerformanceTransaction
Description
End Performance Transaction must be performed after StartPerformanceTransaction. It takes the collected data on Duration CPU, Battery and Memory of the current device, and upload it to SeeTest Reporter.
The collected data can be viewed under the transaction tab in SeeTest Reporter.
Parameters
Name | Value |
---|---|
Name | Name of the transaction to save |
Usage
This will end a performance transaction. An exception is thrown if trying to end a transaction without starting.
You can view the transaction, once ended, in SeeTest Reporter under "Transactions" tab.
info
Note:
- Supported version Android 5.0+ and all iOS versions.
- A transaction maximum time is 5 min. After 5 minutes transaction will be canceled
- The transaction will be canceled if you release client/quit driver. No data will be saved
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
EndPerformanceTransaction
String accessKey = "<accessKey>"
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");
Result Example
{
"transactionName": "transaction test",
"transactionId": 10,
"appName": "com.experitest.ExperiBank",
"appVersion": "1.2890",
"deviceInfo": {
"uid": "RGF8MM81FK8SV",
"model": "SM-G973F",
"name": "samsung SM-G973F",
"deviceType": "ANDROID",
"category": "PHONE",
"manufacturer": "samsung",
"osVersion": "9.0",
"emulator": false,
"mssbSupported": false
},
"deviceScreenDimension": {
"width": 1080,
"height": 2042
},
"metrics": {
"startTimestamp": 1683028885746,
"endTimestamp": 1683028901275,
"cpuAvg": 0.440625,
"cpuMax": 0.95,
"memoryAvg": 40.923583984375,
"memoryMax": 71.8056640625,
"batteryAvg": 0.046218749999999996,
"batteryMax": 0.174,
"nvProfileName": "",
"networkDownload": 0,
"networkUpload": 0
},
"link": "https://mycloud.experitest.com/test-trans/index.html?trans_id=1234"
}