Forum Discussion

Claddaghduff's avatar
Claddaghduff
Occasional Contributor
3 years ago
Solved

How to enter a linefeed into a variable for a Property Checkpoint

I have a project variable that I use to check against a value on a web page. The actual value contains a linefeed (I believe) as when I recorded the test the expected value was as, "Accession No:\n4031533211975680". I copied this value into the variable value in the variable editor. As the value is a multiline field it placed it on 2 lines and the "\n" was not shown. When I ran the test it failed and the the following appeared (note the missing "↴")

 

Actual value Expected value
"Accession No:↴4031533211975680"
"Accession No:4031533211975680"

 

I edited the variable and added a "\n" and reran the test. Again it failed showed the following result.

 

Actual value Expected value
"Accession No:↴4031533211975680"
"Accession No:\n4031533211975680"

 

I also tried using "\r\n" but still no success. 

 

My questions are:

1) Is the "↴" shown in the actual a linefeed?

2) How do I put it into a variable to be used for a checkpoint as it is taking the \n a a string not an escape sequence?

 

Thanks, Alan

  • Hi Claddaghduff 

     

    Change the Condition of the checkpoint to "Matches (regular expression)" (or in Keyword edit, "cmpMatches"). This will allow TestComplete to pick up the \n escape character then.

     

    Thanks

    Mike

     

1 Reply

  • Hi Claddaghduff 

     

    Change the Condition of the checkpoint to "Matches (regular expression)" (or in Keyword edit, "cmpMatches"). This will allow TestComplete to pick up the \n escape character then.

     

    Thanks

    Mike