Assert blank space


#1

Hi,

I want to assert that one blank space is visible in my text.
When I create a variable with one blank space, sometimes the value (blank space) is deleted. The variable was visible anymore, but without any value.

Is there a possibility to assert a space in a text?

Thanks a lot and nice weekend.
Ronny


#2

Hi Ronny,

All commands that perform any kind of text assertion, perform white-space normalization on both, the input text and the assertion value. This is because browsers also normalize white-space when rendering text content in HTML.

White-space normalization in this context means that all white-space characters are replaced with a single blank space and the result is finally trimmed (white-space at the beginning and at the end are removed).

When reading and parsing the script files, white-space normalization is also performed for all command values that are known to treat with element text.

As a workaround, you might use one of the text matching strategies regexp or regexpi that interpret the assertion value as regular expression, e.g. assertText id=targetElementId regexp:\s
In case it does not matter whether the displayed text is blank or empty, a text assertion with an empty value should do it.

Hope that helps.

Thanks,
Hartmut