+

Search Tips   |   Advanced Search


Monitor vitals


Overview

NeoLoad provides a MonitoringHelper class to monitor the vitals of the mobile being tested.

Available vitals depend on the mobile device tested and may contain:

For more information about the vitals available for each mobile device, please refer to Jamo Solutions documentation.


Add dependent libraries

To monitor the vitals, you need to add to your project the following dependency:

neotys-rest-api-dataexchange-client-X.Y.Z.jar.

This dependency can be downloaded from the Neotys Labs page.


Declare the monitoring class

MonitoringHelperBuilder class enables to create the MonitoringHelper object.

MonitoringHelperBuilder uses the following parameters:

Here is an example of Java code to create a MonitoringHelper object in order to monitor the vpba16 mobile:

import com.neotys.rest.dataexchange.monitoring.MonitoringSupplier;
import java.util.List;
import java.util.ArrayList;
import com.neotys.rest.dataexchange.monitoring.MonitoringHelper;
import com.neotys.rest.dataexchange.monitoring.MonitoringHelperBuilder;

final MonitoringSupplier monitoringSupplier = new MonitoringSupplier(){
	@Override
	public List<String> get() {
		final List<String> xmlOutputs = new ArrayList<>();
		try {
			xmlOutputs.add(vpba16.batteryInfo());
			xmlOutputs.add(vpba16.driveInfo());
			xmlOutputs.add(vpba16.memoryInfo());
			xmlOutputs.add(vpba16.phoneInfo());
			xmlOutputs.add(vpba16.processInfo());
			xmlOutputs.add(vpba16.screenInfo());
		} catch (final MeuxException e) {						
		}
		return xmlOutputs;
	}		
};
final MonitoringHelper monitoringHelper = (new MonitoringHelperBuilder(monitoringSupplier, dataExchangeAPIClient)).build();


Use the monitoring class

With the MonitoringHelper class, you can start and end the monitoring of vitals on a mobile.

The start of the monitoring is done via:

The end of the monitoring is done via:

Example of Java code to start and end the monitoring of vitals on a mobile:

// Start vitals monitoring
monitoringHelper.startMonitoring();

// Do some transactions

// Stop vitals monitoring
monitoringHelper.stopMonitoring();


Home