Forum Discussion

Nasturshia's avatar
Nasturshia
Occasional Contributor
4 years ago

Cannot convert string to a double

Using Soapui v 5.4.0 and A script assertion which has numerous def and assert statements in it.

A def statement produces the error shown in the subject of the post what does this mean?

Def Count01 = Cdataxmlholder [“count((//*[local-name() = ‘list01’] /*[local-name () = list02 and . = + expectedlist + “])”]

The expected list variable is defined at the start if the assertion script.

Please advise thank you

8 Replies

  • Nasturshia : Could you please attach any screenshot or error which you are getting and also code which you are using. It will be helpful to resolve the issue.

    • Nasturshia's avatar
      Nasturshia
      Occasional Contributor
      Hi Himanshu, not easy to attach any files as the assertion script is held on a secure server.

      I just need a clue where the variable is defined and what the message means.

      Thanks
      • richie's avatar
        richie
        Community Hero
        Hi Nasturshia,

        The error response is saying it cant cast a string type to a double (numeric) type. So whatever that variable is being set a string is trying to be read in as numeric. Thats it. Does that help you diagnose the issue?

        If it doesnt then @HimanshuTayals probably going to need to see your script assertion code (and the full error details just in case theres any further helpful info outside the initial cast error)

        Ta

        Rich