Verify Text is failed

Hi All,

1.I have extracted the below message using Get Text activity and stored in variable “BatchTxT”

  1. Used Verify expression with Operator but the text is mismatched.

For more Details:

@shruthi_arali

As per the screenshot we can see that there are extra double quotes in the given text…please check the same

Cheers

@Anil_G

Its not the double quotes issue. please find the below screenshot. For passed data also it shows the same as below.

@shruthi_arali

Got it…

If you check the first acreenshot you procided where it failed…the new line characters are diffrrent in both the texts…one in extracted one and one in the given one

In extracted nee line is \r\n and in given it is \n

Try comapring without newlines…or by replacing them

Cheers

@Anil_G

How to remove new line from extracted text

@shruthi_arali

Use batchTxt.Replace(Environment.NewLine,"")

If this does not work you can as well try batchTxt.Replace("\r\n","\n")

Or we can use regex and replce all the space related charqcters and then compare

System.Text.RegularExpressions.Regex.Replace(batchTxt,"\s","")

Cheers

1 Like

@Anil_G
I got below value when used System.Text.RegularExpressions.Regex.Replace(BatchTxT,“\s”,“”)
“10Theselectedlotisreserved.Pleaseselectanotherlot”

How to convert to “10 The selected lot is reserved. Please select another lot”

@shruthi_arali

The purpose of \s is to remove any kind of spaces…on the right verification as well use similar expression or remove all the spaces and compare the data

Or if you want to replace only newine characters then use this regex and try "\r?\n"

Cheers

@Anil_G

Thank You

1 Like