CompareTo with Image parameter fails

Help
Faizal
2010-02-04
2013-02-18
  • Faizal

    Faizal - 2010-02-04

    I'm trying to use the CompareTo command which takes in an Image parameter but it is failing with the following:

    java.lang.ClassCastException: com.tplan.robot.imagecomparison.search.SearchImageComparisonModule cannot be cast to java.lang.String
    at com.tplan.robot.scripting.commands.impl.CompareToCommand.validate(CompareToCommand.java:169)
    at com.tplan.robot.scripting.commands.impl.CompareToCommand.execute(CompareToCommand.java:310)
    at com.tplan.robot.scripting.AbstractJavaTestScript.runScriptCommand(AbstractJavaTestScript.java:160)
    at com.tplan.robot.scripting.DefaultJavaTestScript.compareTo(DefaultJavaTestScript.java:3198)
    at com.tplan.robot.scripting.DefaultJavaTestScript.compareTo(DefaultJavaTestScript.java:3215)
    

    I see the line in the source code where it is checking if SearchImageComparisonModule is an instanceof ImageComparisonModule but not sure why it is failing since - according to the javadoc - SearchImageComparisonModule implements ImageComparisonModule.

    http://www.vncrobot.com/docs/v2.0/api/com/tplan/robot/imagecomparison/search/SearchImageComparisonModule.html

     
  • Robert Pes

    Robert Pes - 2010-02-04

    It is a bug. I filed it as 2946068. The fix is simple - the parameter should not be casted to String in CompareToCommand.java:169. Will be fixed in next release (2.0.3).

     

Log in to post a comment.