Feature request : custom validation action

Bug reports.
reto2011
Posts: 4
Joined: Tue Jun 11, 2013 9:33 pm

Feature request : custom validation action

Post by reto2011 » Tue Jun 11, 2013 10:46 pm

Hi,

I am new here. I'm am currently evaluating Ranorex. I am testing an application, which generates logs (window messages), that I am able to catch within any third party application. I would like to catch these logs automatically during a ranorex recording, and to create a custom validation action, that will validate the log entry. So, when I replay the recording module, the test module will test if my application logs the same messages as during the recording.
Is it possible to do that kind of validation with Ranorex ? If so, can someone give me a sample code that do that kind of validation ?

Thanks
Elisa

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Feature request : custom validation action

Post by Support Team » Wed Jun 12, 2013 4:12 pm

Hello Elisa,

You can use the 'Validate' button to pause the recording in order to validate some attributes in the recorded element.
I don't know how your application looks like and which attributes are available, but you can try to enable the "Text" attribute in order to validate the text of a specific item.
Please read the section "During Recording" in our user guide in order to get more information how to use the validation functionality in the recorder.
Please let me know if I didn't understand you correctly.

Regards,
Bernhard

reto2011
Posts: 4
Joined: Tue Jun 11, 2013 9:33 pm

Re: Feature request : custom validation action

Post by reto2011 » Wed Jun 12, 2013 8:57 pm

Hi Bernhard,

thanks for the reply. The problem is the logs generated by my application are not visible elements. As far as I know , the "Validate" button only works to validate images or attributes of a UI element. But, these logs are not attributes of my application, they are just messages to notify others applications that an event occured. Besides, my application can log events at any moment. So, I can't know at what time, I have to pause the recording.

I would need a function OnNewLog() that would be called every time my application generates a new message. This function would pause the recording and create a new User Code action ValidateLog() and save the log entry in a string variable LogEntryX. So, for each generated log during the recording, we would need to create a new User Code Action and add it to the list of actions of the recording module.
When the recording is replayed, the ValidateLog() validation action should wait for the event NewLogEvent(). When this event is raised, it will compare the actual log entry with the variable LogEntryX saved during the creation of the recording module.

I would be very helpful, if it was possible to add a User Code Action automatically at the end of the list of actions in the recording module. The User Code Action should include a string containing the log entry. Is it possible to add a User Code Action automatically with some code ?

Thanks
Elisa

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Feature request : custom validation action

Post by krstcs » Thu Jun 13, 2013 2:29 pm

Ranorex is a Functional User Interface automation tool. So it isn't really designed for what it sounds like you are trying to do with it. It is designed to test the user interface, and therefore the visual aspects of the design.

However, you could add a listener to your test that subscribes to your messages, depending on how the system under test is constructed. I have never personally done it, so I couldn't begin to tell you how, but you might want to talk to your developers about it and see if they know a way.

The nicest part of Ranorex is that it is built on .NET, so anything you can do in .NET you can do in Ranorex.
Shortcuts usually aren't...

reto2011
Posts: 4
Joined: Tue Jun 11, 2013 9:33 pm

Re: Feature request : custom validation action

Post by reto2011 » Thu Jun 13, 2013 7:23 pm

Thank you for your suggestion, I will talk to the other developers in my team to see what they think about using a listener that subscribes to the messages.