Problem in specifying passrate in compareTo

Help
2010-04-15
2013-02-18
  • Aanchal Gupta
    Aanchal Gupta
    2010-04-15

    Hi,

    I always get error when I try to specify the 'passrate' in compareTo method.
    E.g:
    I will get an exception at this line:
    int result = compareTo(new File { new File("/home/screenshots/roses.png") }, "search", (float) 95.0);

    Error Logs:
    java.lang.ClassCastException: java.lang.Float 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:3240)
    at com.mypackage.TestClassWhichIsNotWorking.test(TestClassWhichIsNotWorking.java:29)
    at com.tplan.robot.scripting.interpret.java.JavaTestScriptInterpret.execute(JavaTestScriptInterpret.java:248)
    at com.tplan.robot.scripting.ExecOrCompileThread.run(ExecOrCompileThread.java:51)

    This error does not occur when I use passrate in waitForMatch function.
    Pls suggest a solution to this if I wish to use compareTo.

     
  • Robert Pes
    Robert Pes
    2010-04-15

    Not reproducible on my environment. The position mentioned in the stack trace doesn't refer to a valid place in the code any more. I suggest you to retry with the version which is about to release.

     
  • Aanchal Gupta
    Aanchal Gupta
    2010-04-19

    yeah…it works with 2.0.4  
    Thanks.. :)