qentinelqi / qweb

Keyword driven automation for the web
https://github.com/qentinelqi/qweb
Apache License 2.0
40 stars 17 forks source link

Inconsistent behavior in GetInputValue vs VerifyInputValue #144

Closed tkoukkari closed 5 months ago

tkoukkari commented 7 months ago

Describe the bug Linebreaks in textarea are removed with GetInputValue but not with VerifyInputValue

To Reproduce Steps to reproduce the behavior:

  1. Go to https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_textarea_form

  2. Type an address containing line breaks to the textarea, for example:

    123 Main Street
    Apt. 4B
    Springfield, IL 62704
  3. Get the input value: ${text}= GetInputValue comment

Text will be returned without linebreaks, i.e. 123 Main StreetApt. 4BSpringfield, IL 62704

  1. 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.

tkoukkari commented 6 months ago

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.

tkoukkari commented 5 months ago

Fix included in version 3.3.0