Ask general questions here.
- Posts: 31
- Joined: Fri Nov 27, 2015 11:32 am
i have a recording in which I use getValue
from an element, store it in a variable and then compare this with the text of a later component.
Unfortunately the value contains spaces like
, and the final component to validate has only
Currently I use AttributeRegEx
as comparison, which works, but I would rather trim the value I receive.
Can someone explain me step by step how to trim a value when receiving it via getValue in a recording module ?
- Ranorex Guru
- Posts: 2683
- Joined: Tue Feb 07, 2012 4:14 pm
- Location: Austin, Texas, USA
Trimming the value will require using User Code. It cannot be done in the action table.
Assuming your actual value is stored in the variable named "actual" and your expected value is in "expected":
Code: Select all
string actual = " text ";
string expected = "text";
I put the Trim() function on both to ensure that both are treated exactly the same way, just in case.
Shortcuts usually aren't...