Forum Discussion

3jtechtest's avatar
3jtechtest
Occasional Contributor
13 years ago

TestComplete sends WebService call parameter with mantissa causing an error

Our WebService has one of the parameters defined as data type - double.

When calling WebService in TestComplete and passing in the  values (e.g 0.01,0.002,0.0003)  everything seems to work Ok.

However, when value is passed into the parameter with 5 decimal points (e.g 0.00003)

the TestComplete must be formatting it with mantisa as the exception is thrown by the WebService:

The value '3E-5' cannot be parsed as the type 'decimal'.</faultstring><detail><ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07

....



Is anyone aware of the configuration setting within TestComplete so that sending double(float) value in the scientific notation can be turned off?

13 Replies

  • 3jtechtest's avatar
    3jtechtest
    Occasional Contributor
    Hi Alex,

    I have opened Support request but still didn't get resolution to the problem.

    BTW, I am developing in JScript, as that's what the project is setup with.

    Calling aqString.Format() in all 3 cases displays the value as expected: 0.00003. It's strange that in DelphiScript the 3rd case is not valid

    However, when TC sends that value via param to the WebService seeing that it's a double data type it converts it using scientific notation number, which WebService doesn't like.

    The data is read from the CSV file using DDT Value call and replaced with params to WS.

    As previously stated, even when I hard code 0.00003 into a parameter to WS, it still gets rejected by the WS, as the TC sends it as 3E-5 number and not a decimal.



    Regards,
  • AlexKaras's avatar
    AlexKaras
    Community Hero
    Hi Djordje,



    I believe you'll get a response from Support on the created case soon and will appreciate if you let us know the final result here. I love web services testing functionality in TestComplete, like to test web services and had several interesting successful projects with them and this is the reason of why I am interested in this problem.



    The only thought I have now, is do you know if there is some standard that specifies how doubles can be converted to strings? The idea is that if scientific notation is allowed for the string representation of double, then I would say that, generally speaking, TestComplete behaves correctly (though maybe in an unexpected manner) and the problem is with the web service been not able to convert double presented in one of the possible string forms into native binary representation.
  • AlexKaras's avatar
    AlexKaras
    Community Hero
    Hi Djordje,



    Thank you a lot for the update!

    Not sure I completely understood Support's explanation... but this is out of scope.

    Also, it is my understanding, that with the workaround suggested it is not possible to write test code as WebServices.ServiceName.Method(.....,0.00003,....) but you must create the OnWebServiceRequest handler and modify the request there (or create request manually), right?



    Do you know if they are going to fix this problem in (the next) TestComplete update?