assert in groovy fails because of spaces in response and no spaces in database value .Is there any s
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022
01:11 PM
11-23-2022
01:11 PM
assert in groovy fails because of spaces in response and no spaces in database value .Is there any s
in groovy script -comparing soap response with database
values are same but it fails when I asserting it because of spaces in response's data.
error like assertion failed
responseid==dbtableid
|. ||
'23' |23
false
error at line 27
Is there any solution?
Solved! Go to Solution.
Labels:
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022
11:27 PM
11-23-2022
11:27 PM
you need to make sure you compare the same data types (i.e., both are strings or integers).
To get rid of the whitespaces at the beginning and the end strings you can use the trim() method:
myString.trim()
Karel@apimate.eu
https://apimate.eu
https://apimate.eu
