Page tree

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Note: This command can only be added in the code environment (excpet UFT), and not in SeeTestAutomation


This command can be used to retrieve information (of all parameters listed below) on the last command which was executed.
This command can be also useful while generating reports to an external reports system.


The following keys can be found in the map:

  • package - String, Package name of last installed app
  • position - element position (upper left corner of the element)
  • WinTitle - active device the action was made on
  • status - Boolean, indicates if a command succeed or not
  • dtime - the time of a command execution
  • width - width of the element
  • height - height of the element
  • click - click coordinates on click elements
  • img.height - height of the report image
  • img.width - width of the report image
  • screen.height - height of the screen

  • screen.width - width of the screen

  • logLine - string, summarizes the last command 
  • outFile - string, with the path to an image of the report
  • time - time from command to operation
  • - background color name (TEXT Zone only)
  • bcolor - background color value (TEXT Zone only)
  • color - text color value (TEXT Zone only)
  • - text color name (TEXT Zone only)
  • font.size - font size (TEXT Zone only) 
  • step - index of command step in the test
  • found - Boolean, verification of element
  • keys - when command fails to execute
  • errorMessage - string, the error indication
  • exception - string, the exception stack trace (optional)
Note: "TEXT Zone only" means that the key will return values only for objects recognized using OCR (Zone TEXT). Those keys will not work for objects recognized using other identification methods (NATIVE/WEB).


Example script

Description: On the following Java snippet we will get the status of the isElementFound command

Code Block
titleJava Example
client.isElementFound("NATIVE", "text=login", 0);
Map <String, Object> map = client.getLastCommandResultMap();
String commandStatus= (String) map.get("status");

How to get element font size for Android Devices:

Code Block
// Please change the code for your needs
private double getFontSize(String elementXpath){
    final double MEDIUM_DENSITY = 160.0;// Use YOUR device text density

    final String density ="adb shell wm density");
    final double screenDensity = Double.parseDouble(density.trim().split(":")[1]);
    final double scaledDens = screenDensity/MEDIUM_DENSITY;
    final double pixelSize = Double.parseDouble(client.runNativeAPICall("NATIVE", elementXpath, 0, "view" + ".getTextSize();"));
    return pixelSize/scaledDens;