How to handle '↵↵' character in property checkpoint
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to handle '↵↵' character in property checkpoint
I am using Excel as the data source to compare the field text. I have copied the exact same data from the text field to Excel for comparison. Still, the property checkpoint is failing, as the actual result contains code '↵↵' to represent the next line, while the expected result text contains code '↴↴' for the same... I tried to replace the '↵↵' with '↴↴', but that also not helping.
Solved! Go to Solution.
- Labels:
-
Keyword Tests
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could try using an alt-code to put the expected result into Excel and see if that helps. Excel has a habit of having extra hidden characters in a cell, especially with odd characters.
You could also try comparing the field text as a picture instead of as actual text.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The only workaround I found was to use contains check (instead of equal) and split the text I'm checking for into multiple property checks so the '↵↵' are bypassed
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The default value for carriage return is \r and newline \n.
If your text contains a carriage return, then you can compare the string like so "SmartBear\r"
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, everyone. I have tried all your suggestions and wasn't able to have success. However, I have found another workaround using which I can assert the full text including paragraphs without running into any hidden characters issues.
I am saving the object text to a variable and then using the IF condition to assert it against the Excel value. When a match is found I am logging the checkpoints (log.Checkpoint()) else error (log.error()).
