Type an address containing line breaks to the textarea, for example:
123 Main Street
Apt. 4B
Springfield, IL 62704
Get the input value:
${text}= GetInputValue comment
Text will be returned without linebreaks, i.e.
123 Main StreetApt. 4BSpringfield, IL 62704
Verify the input value with the text returned:
VerifyInputValue comment ${text}
This will not work, since GetInputValue automatically removes newlines (\n), but VerifyInputValue expects them.
Adding linebreaks back will work:
VerifyInputValue comment 123 Main Street\nApt. 4B\nSpringfield, IL 62704
Expected behavior
Value returned by GetInputValue should be the "real" value which can be used in verification directly. Removing line breaks can be easily done outside of this keyword. If it's really needed to be part of this keyword, then it probably should be controlled by an argument.
Actually both already strip newlines, so issues only arise if GetInputValue takes the value and it's used somewhere else. Adding possibility to preserver newlines via argument.
Describe the bug Linebreaks in textarea are removed with GetInputValue but not with VerifyInputValue
To Reproduce Steps to reproduce the behavior:
Go to https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_textarea_form
Type an address containing line breaks to the textarea, for example:
Get the input value:
${text}= GetInputValue comment
Text will be returned without linebreaks, i.e.
123 Main StreetApt. 4BSpringfield, IL 62704
VerifyInputValue comment ${text}
This will not work, since GetInputValue automatically removes newlines (\n), but VerifyInputValue expects them.
Adding linebreaks back will work:
VerifyInputValue comment 123 Main Street\nApt. 4B\nSpringfield, IL 62704
Expected behavior Value returned by GetInputValue should be the "real" value which can be used in verification directly. Removing line breaks can be easily done outside of this keyword. If it's really needed to be part of this keyword, then it probably should be controlled by an argument.