2

Im trying to find an html element with the exact text:

Then assert exists('{a}Enddatum: Bitte geben Sie ein gültiges Enddatum für das Koordinierungsverfahren im Format tt.mm.jjjj an.').exists

THe HTML-Element im looking for looks like this:

<a href="#label_Serviceverfahren_vermittlungsprozesse_0__endzeitpunktDatum">Enddatum: Bitte geben Sie ein gültiges Enddatum für das Koordinierungsverfahren im Format tt.mm.jjjj an.</a>

The assertion fails, i think the ecnoding is the problem, because the 'ü' turns into a '³':

ERROR com.intuit.karate - assertion failed: assert evaluated to false: exists('{a}Enddatum: Bitte geben Sie ein g³ltiges Enddatum f³r das Koordinierungsverfahren im Format tt.mm.jjjj an.').exists

I tried to escape the 'ü' in different Ways, but till now i had no luck.

c0deP
  • 21
  • 3

1 Answers1

1

It is important that you follow this process, because it sounds like a fundamental problem that needs to be fixed: https://github.com/intuit/karate/tree/develop/examples/ui-test

It won't take you much time, here is an example: https://github.com/intuit/karate/issues/1180#issuecomment-646615777

Perhaps you are using the Visual Studio Code / karate.jar option ? In that case, can you try adding this system parameter: -Dfile.encoding=UTF-8

For example, this is the edit you need to make:

enter image description here

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248
  • With the system parameter the 'ü' turned into '├╝': `ERROR com.intuit.karate - assertion failed: assert evaluated to false: exists('{a}Enddatum: Bitte geben Sie ein g├╝ltiges Enddatum f├╝r das Koordinierungsverfahren im Format tt.mm.jjjj an.').exists` I will check the UI Test now, but your links are identical – c0deP Jun 26 '20 at 12:17
  • @c0deP fixed the link. yeah this is weird, would be good to get a sample – Peter Thomas Jun 26 '20 at 12:32
  • 1
    I can't replicate the issue within UI Test project, so it seems to be something on my end, will keep you updated if I find something usefull – c0deP Jun 26 '20 at 13:27