Class ComparisonResult

java.lang.Object
io.appium.java_client.imagecomparison.ComparisonResult
Direct Known Subclasses:
FeaturesMatchingResult, OccurrenceMatchingResult, SimilarityMatchingResult

public abstract class ComparisonResult extends Object
  • Field Details

    • commandResult

      protected final Object commandResult
  • Constructor Details

    • ComparisonResult

      public ComparisonResult(Object commandResult)
  • Method Details

    • getResultAsMap

      protected Map<String,Object> getResultAsMap()
    • verifyPropertyPresence

      protected void verifyPropertyPresence(String propertyName)
      Verifies if the corresponding property is present in the command result and throws an exception if not.
      Parameters:
      propertyName - the actual property name to be verified for presence
    • getVisualization

      public byte[] getVisualization()
      Returns the visualization of the matching result.
      Returns:
      The visualization of the matching result represented as base64-encoded PNG image.
    • storeVisualization

      public void storeVisualization(File destination) throws IOException
      Stores visualization image into the given file.
      Parameters:
      destination - File path to save the image to.
      Throws:
      IOException - On file system I/O error.
    • mapToRect

      public static org.openqa.selenium.Rectangle mapToRect(Map<String,Object> map)
      Transforms a map into Rectangle object.
      Parameters:
      map - the source map.
      Returns:
      Rectangle object
    • mapToPoint

      public static org.openqa.selenium.Point mapToPoint(Map<String,Object> map)
      Transforms a map into Point object.
      Parameters:
      map - the source map.
      Returns:
      Point object