How to click on element with same name ?

Class library usage, coding and language questions.
Posts: 11
Joined: Thu Apr 05, 2007 8:04 am
Location: Switzerland

How to click on element with same name ?

Post by BR_05 » Thu Sep 13, 2007 5:36 pm

I have an GUI (based on javascript) I'm able to click on element with the element name parameter.

And with this GUI, I have several element with the same element name. Is it possible to click on one chosen element by Index or something like that ?

How can I do to specify the element to click ?

Thanks in advance


Site Admin
Site Admin
Posts: 350
Joined: Wed Jul 05, 2006 7:44 pm

Post by webops » Fri Sep 14, 2007 5:07 pm

You can read all elements with the same role and name as follows:

Code: Select all

itemCount = Ranorex.ElementFindChildren(element, Ranorex.ROLE_..., 'Name')

for index in range(0,itemCount):
    child= Ranorex.ElementGetChildFieldItem(index)
    if child == None:
        print 'Cannot read child' + str(index)
    print '      child item =' + child[2]
Ranorex Team