Forum Discussion
HimanshuTayal
Community Hero
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
5 years agoOccasional 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
I just need a clue where the variable is defined and what the message means.
Thanks
- richie5 years agoCommunity HeroHi 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- Nasturshia5 years agoOccasional ContributorRich
Thank you that is helpful.
So It seems I need to look in another script where these elements are defined.
Can you provide an example of defining a variable as a string and integer so I can see what it looks like thank you- richie5 years agoCommunity HeroHey Nasturshia,
In regards to defining variables as strings or numerics, i just slap a .toString() or .toInteger() on it.
I should highlight variables/properties are saved as text/string type by default.
In regards to what the line is actually doing
[“count((//*[local-name() = ‘list01’] /*[local-name () = list02 and . = + expectedlist + “])”]
I cant actually read this to tell you whats going on.....i would need to know what the content of your response looks like cos i dont know what that local-name() method is doing. This is doing a count followed by the xpath to what is being counted which is then beimg concatenated with whatever variable/property defined as 'expectedlist'.
Im not in front of my laptop to actually try an xpath count (to work out if the count value is being stored as text (e.g. '4') or numeric (e.g. 4), but i'm wondering if 'expectedlist' is a stringtype and thats the problem?
Have you tried removing the concatenation of 'expectedlist' from the variable declaration to see what happens? If you remove it and you dont get the error, that'll mean that the expectedlist property is likely causing the issue.
Thats all i got, im afraid!
Ta
Rich
Related Content
- 11 years ago
- 5 years ago
Recent Discussions
- 5 days ago