Ranorex

How to click on element with same name ?

 
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexPython
View previous topic :: View next topic  
Author Message
BR_05



Joined: 05 Apr 2007
Posts: 11
Location: Switzerland

PostPosted: Thu Sep 13, 2007 6:36 pm    Post subject: How to click on element with same name ?
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

BR
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Fri Sep 14, 2007 6:07 pm    Post subject:
You can read all elements with the same role and name as follows:

Code: click into code to enlarge
element=Ranorex.ControlGetElement(form)
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)
        continue;
    print '      child item =' + child[2]

Jenö
Ranorex Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexPython All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum