Error message "No signature of method"

This is community board for the soapUI Community. Here the members can exchange experiences and help each other improve their soapUI testing.

Error message "No signature of method"

Postby maitreyoda » 05 Jun 2012 21:28

Hi all,

I'm using Groovy for the first time and I need your help.

I was using this line in my TestStep :
<SerialNumber xsi:type="xsd:string">${#TestCase#SerialNumber}</SerialNumber>

Now I would like to truncate the value before sending it to the server, using this line :
<SerialNumber xsi:type="xsd:string">${=${#TestCase#SerialNumber}.substring(2, 5)}</SerialNumber>

But I've this kind of error in Request Message of the Step :
<SerialNumber xsi:type="xsd:string">No signature of method: java.lang.Long.substring() is applicable for argument types: (java.lang.Integer, java.lang.Integer) values: [2, 5]
Possible solutions: toString(), toString(), toString(), toString(long, int)</SerialNumber>

What is bad in my request ? Is there another way to do that ?

Thanks,
maitreyoda
maitreyoda
User
 
Posts: 2
Joined: 05 Jun 2012 21:11

Re: Error message "No signature of method"

Postby M McDonald » 07 Jun 2012 16:36

Code: Select all
<SerialNumber xsi:type="xsd:string">${=Long.toString(${#TestCase#SerialNumber}).substring(2, 5)}</SerialNumber>
M McDonald
Wizard
Wizard
 
Posts: 625
Joined: 21 Feb 2008 00:04
Location: New York

Re: Error message "No signature of method"

Postby maitreyoda » 11 Jun 2012 15:33

Thanks M McDonald,

It works perfectly.
I understand now :)

maitreyoda
maitreyoda
User
 
Posts: 2
Joined: 05 Jun 2012 21:11


Return to soapUI Community Board