How to detect automatically generated list item ?

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
flashmark
Posts: 13
Joined: Tue Oct 28, 2014 6:25 am

How to detect automatically generated list item ?

Post by flashmark » Tue Oct 28, 2014 6:49 am

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

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

Re: How to detect automatically generated list item ?

Post by krstcs » Tue Oct 28, 2014 3:14 pm

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.
Shortcuts usually aren't...

flashmark
Posts: 13
Joined: Tue Oct 28, 2014 6:25 am

Re: How to detect automatically generated list item ?

Post by flashmark » Tue Dec 30, 2014 12:42 pm

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
Attachments
Ranorex.JPG
Ranorex.JPG (76.96 KiB) Viewed 737 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to detect automatically generated list item ?

Post by Support Team » Wed Jan 07, 2015 2:22 pm

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
.
Image