views:

171

answers:

2

Hi all, I am automating a an application written in C#. i dont have its code. in application there is a grid view table containing list of templates. i want to select a particular template by its name and not its row index.

for example: consider the grid view table consisting list of months. Now i want to select "May" month in the list by its name.

I am using IBM RFT 8.1 and found the object for grid view table. but i am not able to select the row entry by its name. Please help

A: 

As you add each Template to the grid, accumulate its name in a HashMap for later retrieval using get():

Map<String, Template> byName = new HashMap<String, Template>;
...
for (Template t : templates) {
    byName.put(t.getName(), t);
    ...
}

Addendum: if the object you're looking at derives from GuiTestObject, I see a getChildAtPoint() method that might help.

trashgod
A: 

@trashgod: Thanks for your input

But the problem is I am not inserting Template to the grid. As i said earlier i dont have code for the application. Using IBM RFT object finder i found that the Template list is of type gridviewtable and The Template i want to select is at row index 24 of that gridviewtable.

I just dont want to select the template using "click(atCell(atRow(atIndex(24))))" method as the developers might change the row index of template at later stage.

when i used "gridviewtable().getChildren()" i didnt get any.

Please help. I am using javascript in my automation code.

Aazim
Ah, sorry, I misunderstood your question entirely: I though you were recreating a C# application in Java. I have not used IBM RFT 8.1. You might want to add this clarification to your original question.
trashgod