18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Asserting Special Characters
I am using sahi web tool for testing our application. I am finding difficulty in asserting special characters (like euro symbol).
For example ::
_assertExists(_cell("€144.00"));
_assertEqual("\u20ac144.00", _getText(_cell("€144.00")));
_assertContainsText("\u20ac144.00", _cell("€144.00"));
this assertion fails
For example ::
_assertExists(_cell("€144.00"));
_assertEqual("\u20ac144.00", _getText(_cell("€144.00")));
_assertContainsText("\u20ac144.00", _cell("€144.00"));
this assertion fails
Comments
€144.00 will have to be specified as \u20ac144.00 to Sahi. (Sahi uses \u encoding for non-ascii characters)
Did you generate that assertion via Sahi or did you copy paste the Euro in your script?
When I recorded for Euro, this is what I got
_assertExists(_cell("\u20ac144.00"));
_assertEqual("\u20ac144.00", _getText(_cell("\u20ac144.00")));
_assertContainsText("\u20ac144.00", _cell("\u20ac144.00"));
This was on Firefox and IE.
Regards,
Narayan
_assertExists(_cell("€144.00")); is because the cell name is like that.
Sahi uses the "\u" encriptying that why we can see the "\u" instead of euro character in the next 2 lines
_assertEqual("\u20ac144.00", _getText(_cell("€144.00")));
_assertContainsText("\u20ac144.00", _cell("€144.00"));
But on clicking the "Test" button it is saying "Syntax error ; missing".
How can we assert the non ascii characters?..
To make your script work, just replace Euro with \u20ac in your script.
Regards,
Narayan