//Additional dependencies if needed import org.apache.commons.lang3.time.StopWatch; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; //Create new stopwatch timer StopWatch stopwatch = new StopWatch(); stopwatch.start(); // Go to some website so just this script does something driver.get("https://www.nfl.com"); // Here I would wait for some element to show up but I'll just use a hard wait Thread.sleep(10000); // Stop the StopWatch stopwatch.stop(); //Get the timer and put it in a variable long x = stopwatch.getTime(); //Convert the result to a string String numberAsString = Long.toString(x); //Report it to Perfecto Map params1 = new HashMap<>(); params1.put("name", "stopwatch timer"); params1.put("result", numberAsString); Object result1 = driver.executeScript("mobile:status:timer", params1);