Dealing with mmc and changing column sorts

Ranorex Spy, Recorder, and Studio.
houseofcutler
Posts: 52
Joined: Fri Mar 21, 2014 4:22 pm

Dealing with mmc and changing column sorts

Post by houseofcutler » Fri Mar 21, 2014 4:42 pm

Hi All,

I am new to Ranorex but so fr it looks great. The automation side of things is fine and very powerful however I am having trouble when testing a product which uses mmc as a command console.

I got around the issue with dynamic IDs but now have a problem where I am trying to locate a text value within a column but the row it is no may change (due to sorting or additional items being added)

Ranorex always defaults to creating a row item in the repository and if i change this to column it does not work. What would be the simplest way to address this issue please?

I have attached a screenshot of the list. So for example if I want to locate and perform an action on an item in the 'name' column knowing that its position in the list may change what should I change the xpath to?

Your help would be very much appreciated

Thanks
Attachments
spy.PNG
spy.PNG (29.81 KiB) Viewed 954 times
mmc_List.PNG
mmc_List.PNG (36.96 KiB) Viewed 954 times

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

Re: Dealing with mmc and changing column sorts

Post by Support Team » Mon Mar 24, 2014 3:57 pm

Hello houseofcutler,

Unfortunately it is hard to say how the change of the position of the element in the list reflects in the RxPath. Therefore, I may ask if it is possible for you to provide a Ranorex snapshot file of your application to us?
If yes, please upload it to our forum or send it to: [email protected]

Thank you in advance!

Regards,
Robert
.
Image

mzperix
Posts: 137
Joined: Fri Apr 06, 2012 12:19 pm

Re: Dealing with mmc and changing column sorts

Post by mzperix » Thu Mar 27, 2014 8:57 am

I have two remarks regarding your issue.

Remark 1

As I see you are looking for an exact match

Code: Select all

cell[@text='Alert-Photo']
Sometimes I had a problem, that there were white spaces in the cell we looked for.
Try to change the rxpath to

Code: Select all

cell[@text~'Alert-Photo']
This way you look for a cell containing the text 'Alert-Photo'

Please note, that the whole matching mechanism is case sensitive.

Remark 2

Regarding your concrete issue, just leave out the index number of the row, like this:

Code: Select all

/form[@processname='mmc' and @class='MMCMainFrame' and @instance='1']//table[@class='SysListView32']/row/cell[@text~'Alert-Photo']
This xpath should find the cell containing the text 'Alert-Photo'.

Best Regards,
Zoltán Major

houseofcutler
Posts: 52
Joined: Fri Mar 21, 2014 4:22 pm

Re: Dealing with mmc and changing column sorts

Post by houseofcutler » Mon Mar 31, 2014 5:16 pm

Sorry I haven't update for a few days.Thank you for the responses - I was able to solve my issue using the advise offered.

My Project now contains:

Rooted Folder for centre window:

Code: Select all

 ?/?/form[@title~'^Console\ Root\\Groupcall']/?/?/table[@class='SysListView32'] 
Specific Job Item:

Code: Select all

row/cell[@text='Dashboard-Heartbeat']
Following siblings

Code: Select all

row/cell[@text='Dashboard-Heartbeat']/following-sibling::cell[@columnindex=3]
And I have also added items with variables for data driven testing:

Code: Select all

row/cell[@text=$varJobName]/following-sibling::cell[@columnindex=1]
So far the evaluation is going well :D

Thanks again