How to store verification output message as a variable?


I’m building some QA scripts with data driven test activities. Namely, I’m verifying that scraped data matches a database’s stored data. Upon failure/success, there is this verification output message that posts to the console. Is it possible to store that message as a variable so I store that message in our database?

Hi @Justin_Cho,

to get text from a system or application you can use the Get Text activity which will extract the text for later use. if that doesnt work well extracting the specific data from the console you can also use hotkeys to highlight and copy information from the console.

Many thanks

That’s not what I’m asking about. I know how to use the Get Text activity to store text from a page to a variable. I’m asking if I can store the verification output message that is part of the verify expression with operator activity to a variable so I can insert that string into a datatable? If not its fine, I can just make a string myself with my variables for sql

Hi @Justin_Cho,

Welcome to the community. Quite an interesting request you have there!
I could not find a default method to get the console log value from a Verify Expression from a testing activity.

I did try to place the verification activity in a try catch activity :no_entry_sign: . No luck, the message we get in the console does not trigger a catch block as the failure is not considered as an error message. In addition, there are no granular exception types, which can be caught in the current version of UiPath Testing Activities (1.4.6).

So there are two possible ways - workarounds

Alternative 1 : Using the Output (Result) which is a boolean. This would result in either the value of the execution False or True. You can use this as a trigger to assign additional variables for both cases and use them in your datatable.

Alternative 2 : The verification message in the console is essentially logged to the execution logs and must be available in the Test Robot, Orchestrator or Test Manager.
So, you can possibly use the Orchestrator APi To get the last few logs message and filter message to where you find a particular keyword. For example "The Expression"

I am hoping there is someone in the forum who has gotten their hands dirty with this and can give some inputs. I am interested to know what other approaches exists.

1 Like

I’m currently doing what you’ve posted as the alt 1. I set some variables to true/false based on the output result variable and have the bool values inserting into my datatable as a placeholder for now.

It simply looks like testing activities don’t currently have a built in function to post the verification output msg elsewhere. Which is ultimately fine cause I can just make a conditional that builds a string that provides the same descriptive details based on the output result’s bool value.