Customize M-eux scripts
Create manual timers
To create manual timers, you need first to create the Data Exchange API Client as described below.
The NeoLoad Data Exchange API Client provides the utility TimerBuilder in order to time a transaction (a set of business actions).
Below is an example of Java code to add a timer.
import com.neotys.rest.dataexchange.model.TimerBuilder;// Start timerfinal TimerBuilder timer = TimerBuilder.start("scriptName", "timerName");// Do some transactionsvpba16.avw_backboneCellarAndro.avw_.mo_cHATEAU_LE_DOYENNE.click();// Stop timerdataExchangeAPIClient.addEntry(timer.stop());It is possible to enhance the timer’s information with specific data, for example a URL, a status, etc. as shown below:
import com.neotys.rest.dataexchange.model.Status.State;import com.neotys.rest.dataexchange.model.TimerBuilder;import com.neotys.rest.dataexchange.model.Status;import com.neotys.rest.dataexchange.model.Status.State;import com.neotys.rest.dataexchange.model.StatusBuilder;// Start timerfinal TimerBuilder timer = TimerBuilder.start("scriptName", "timerName");// Do some transactionsvpba16.avw_backboneCellarAndro.avw_.mo_cHATEAU_LE_DOYENNE.click();// Specify URLtimer.url("myURL");// Specify Statusfinal Status status = (new StatusBuilder()).code("code").message("message").state(State.PASS).build();timer.status(status);// Stop timerdataExchangeAPIClient.addEntry(timer.stop());The transactions’ timers are then accessible in the Runtime and Results views of NeoLoad:
Home