Forum Discussion
SmartBear_Suppo
Alumni
16 years agoHello,
I'm not quite sure what your script is supposed to do, but as it is posted, it contains several errors.
You need quotation marks around this string for it to be a string, like this:
This line may or may not be correct, depending on what varInt is. If you meant the CharInt variable from the line before, this would be invalid, as the string given cannot be parsed into an integer, due to the non-numerical values in it. However, given the error you say you get: "No signature of method: static java.lang.Integer.parseInt() is applicable for argument types: (java.lang.Integer) values: [2000]", it instead seems that the contents of varInt is already an integer. Trying to parse an int from an int is redundant (it's already an int), so there is no method for doing so, which is why you're getting that error.
The Integer.parseInt() method can take a String containing a valid integer value, for example: "2000".
Regards,
Dain
eviware.com
I'm not quite sure what your script is supposed to do, but as it is posted, it contains several errors.
def CharInt = I have 2000 bucks
You need quotation marks around this string for it to be a string, like this:
def CharInt = "I have 2000 bucks"
def count = Integer.parseInt(varInt)
This line may or may not be correct, depending on what varInt is. If you meant the CharInt variable from the line before, this would be invalid, as the string given cannot be parsed into an integer, due to the non-numerical values in it. However, given the error you say you get: "No signature of method: static java.lang.Integer.parseInt() is applicable for argument types: (java.lang.Integer) values: [2000]", it instead seems that the contents of varInt is already an integer. Trying to parse an int from an int is redundant (it's already an int), so there is no method for doing so, which is why you're getting that error.
The Integer.parseInt() method can take a String containing a valid integer value, for example: "2000".
Regards,
Dain
eviware.com