How to extract certain text from UI error messages

Hi All,

UI displays the exception/validation messages on the screen,but I want to extract that has the lines “Changed store Store1 from Open to Closed” and also it will have multiple stores that are changed from Open to Closed

As of now I am using replace,

DiffMsg.ToString.Replace(“Begin calculating operations to be performed”,“”).Replace(“Change store”,“”).Replace(“Finished calculating operations to be performed”,“”).Replace(“Diff Messages “,””).Replace(“Diff Calculation Completed successfully”,“”).Replace(Environment.NewLine,“”).ToString

Now it just extracts all the texts between Begin calculating operations to be performed, Change store and Diff Calculation Completed Successfully. Diffmsg is the complete validation text

You want to analyse validation messages for the above string?

you can do that using ‘contains’.

ValidationMsgVar.Contains(“Changed store Store1 from Open to Closed”)

But how to extract lines having only those string.

When I use replace it extracts other messages that appears between the given headers

Just put the the condition in an IF activity.

IF ValidationMsgVar.Contains(“Changed store Store1 from Open to Closed”)

THEN Extract Message

ELSE Ignore

condition is executing properly but how to extract only those line on the UI that has “Open to Closed” is not working as expected

It just takes all the lines before and after “Changed Store 1 to Open to Closed”

So if the condition works then you have identified a line/row which matches. Why not add the validation message to a new datarow in separate datatable to output at the end of the workflow? I don’t understand

I need to take the messages that is getting displayed on UI
I am trying with Reg ex