How to validate text in a log file

Ask general questions here.
bertrobb
Posts: 2
Joined: Wed Jul 19, 2017 10:03 pm

How to validate text in a log file

Post by bertrobb » Thu Jul 27, 2017 5:24 pm

Is there a quick and easy way to validate a text string in a log file without calling out the editor, open the file, find the string, then close the file?
Bertski

jma
Posts: 107
Joined: Fri Jul 03, 2015 9:18 am

Re: How to validate text in a log file

Post by jma » Fri Jul 28, 2017 9:56 am

Hi bertrobb,

Since Ranorex is based on the .NET framework you can easily implement such a use case.

First, please create a user code action which allows you to implement your custom code.

In order to read text directly from a file, you will need to use the corresponding methods from the .NET framework, for example: https://docs.microsoft.com/en-us/dotnet ... -text-file

After that, you can validate the string value by using the Validate-class from the Ranorex API.

I hope that helps.