Page 1 of 1

How to detect automatically generated list item ?

Posted: Tue Oct 28, 2014 6:49 am
by flashmark
Hi,

I've to test an application using Ranorex. When automating our application using Ranorex, I got a problem when detecting list item.
1.There is a test module to send messages from the client to server.After sending a message, client should receive response from the server if it is successfully delivered.

The request and response like this.It contains time (actual time),Msg size(static) and msg ID(Auto generated).
The put contains priority(static) as well

11:07:19.784:Server rec:100KB.Id:0c484a32-e2e23e-224234-2423423424
11:07:19.508:Put:100KB.Id:0c484a32-e2e23e-224234-2423423424. Prio:SYS

When playback, ranorex always look for the items which is recorded.But actually the ID is changed each and every time.
I want to make sure for each "put", receive a correct response from the server(Both IDs in "put" and "response" are same)

thanks

Re: How to detect automatically generated list item ?

Posted: Tue Oct 28, 2014 3:14 pm
by krstcs
If you post the XPath you are using we might be able to help you with the format and regular expressions.

What I would do is setup two repo objects, one for the put, one for the response, but use the same variable in each like this:

Response => /cell[@text~'Put:' + $MessageID]
Put => /cell[@text~'Server rec:' + $MessageID]

Then, you can do the PUT action in your test, save the id to the $MessageID variable and then validate that the Response object exists, given an appropriate timeout.

Re: How to detect automatically generated list item ?

Posted: Tue Dec 30, 2014 12:42 pm
by flashmark
krstcs wrote:If you post the XPath you are using we might be able to help you with the format and regular expressions.

What I would do is setup two repo objects, one for the put, one for the response, but use the same variable in each like this:

Response => /cell[@text~'Put:' + $MessageID]
Put => /cell[@text~'Server rec:' + $MessageID]

Then, you can do the PUT action in your test, save the id to the $MessageID variable and then validate that the Response object exists, given an appropriate timeout.
Hi,

Please see attached screenshot.
Sorry for the late response.

thanks in advance

Re: How to detect automatically generated list item ?

Posted: Wed Jan 07, 2015 2:22 pm
by Support Team
Hi flashmark,

Have you already tried what krstcs suggested?
A regular expression similar to the following one should work:

Code: Select all

Response => /listitem[@accessiblename~'Put:.*' + $MessageID]
Put => /listitem[@accessiblename~'Server rec:.*' + $MessageID]
Regards,
Markus