Manipulating RxPath for List purposes

Ask general questions here.
blackout
Posts: 14
Joined: Thu Mar 14, 2013 10:07 am

Manipulating RxPath for List purposes

Post by blackout » Wed May 01, 2013 4:23 pm

Sorry to bother you all again, but this is sort of linked to problem I posted (and sort of resolved myself with a little help from gannias) yesterday: Here

Again, it's to do with all of the images that I have floating around in a single root folders in my repository, although these all appear on 'different' pages.

Therefore, the only way to distinguish between the images is through the persons name associated with it; the RxPaths for the images look something like this:

Code: Select all

.//div[#'person1']/div/img[1]
.//div[#'person2']/div/img[1]
.//div[#'person3']/div/img[1]
.//div[#'person4']/div/img[1]
etc.
I've set up a list with person1, 2, 3, 4, etc added.

Is there any way to loop through my list, using these values to determine which picture to look at?

I'm basically trying to loop through a repository folder based on RxPath's, and I have no idea how to break it down in such a way that it's efficient.

Any and all help greatly appreciated...


Cheers.

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

Re: Manipulating RxPath for List purposes

Post by Support Team » Fri May 03, 2013 2:13 pm

Hello,

If I got your question correctly, you want to iterate over your images efficiently. Is that correct?
Is the RxPath the same for all of your images?

What about using a variable for your person name (e.g. varPerson).
You could create one item with the following RxPath e.g.:

Code: Select all

.//div[#$varPerson]/div/img[1]
Then, you could bind this variable to a data source.
Please let me know, if that would be a possible way for you?

Thank you in advance.

Regards,
Markus (T)
.
Image

blackout
Posts: 14
Joined: Thu Mar 14, 2013 10:07 am

Re: Manipulating RxPath for List purposes

Post by blackout » Fri May 03, 2013 2:49 pm

Sorry if I wasn't very precise in my explanation of the problem...no, they are all in the same FOLDER, but they are separate items within the repository folder.

Also, I'm trying to avoid external data sources as the only thing I plan on updating is Ranorex, not an external source also.


Cheers.

*EDIT*Also, the RxPath is almost the same, but with the [#'NAME'] part in the middle being the bit I want to loop through.

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

Re: Manipulating RxPath for List purposes

Post by Support Team » Mon May 06, 2013 2:32 pm

Hello,

Thank you for your information to clarify your use case.

The simplest way would be to create a 'Simple data table' in order to store your names.
A 'Simple data table' is not an external data source since it is stored in the Test Suite directly.

Another (advanced) option would be to use Reflection to get your child elements of your folder.
Please take a look at Using reflection to get repository item in our Forum.

Regards,
Markus (T)
.
Image