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.
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
Set Experitest Url and Access Key
Please make sure you replace <EXPERITEST_URL>, <ACCESS_KEY> with appropriate URL and access key in the sample code below.
- For SeeTest cloud, EXPERITEST_URL needs to be https://cloud.seetest.io/wd/hub/
- For Dedicated Experitest Lab, EXPERITEST_URL needs to be your own domain. e.g - https://company.experitest.com
Example
EndPerformanceTransaction
String accessKey = "<accessKey>" String url = "<EXPERITEST_URL>"; 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");