Forum Discussion

abhishek813's avatar
abhishek813
Frequent Contributor
11 years ago

asserting special characters

Hi Guys,

I have weird problem.

I have a test case where i have to check that the data in one of the nodes is same as in the db the node is repeated multiple times hence i cannot use a normal test step assertion.

The problem is the the value is going to have special characters and for whatever reason the assert keeps failing.

The string to be searched is AA123 `~!@#$%^&*()-_=+ [{]}\|;:'",<.>/ ?

These are the steps i am doing

1. Loop for all the node values in the db
2. Initialize a variable i = 1
3. using the xpath extract the ith value from the xml
4. assert that the value in the db and in the xml match
5. give a sensible if the assert files.

Note: the data in the db is stored as AA123 `~!@#$%^&*()-_=+ [{]}\|;:'",<.>/ ? and the xml has the value i mentioned earlier.

For security reasons i cannot give the actual response.

Let me know you if anyone has ideas to resolve this.

11 Replies