VB.net webpage element help

DislikeBot

Newbie
Joined
Dec 22, 2012
Messages
1
Reaction score
0
Right say you have a webpage with 100 buttons all with the same value, id, class name etc how would you click the 4th

Its probably very simple but could you use something like for each and count until the 4th

Thanks in advance.
 
That's actually not possible (at least I don't think it is). They should have at least some small differences (ids,classes) or else all the buttons would do the same thing.
Again that's just my opinion. I could be wrong.
 
This is possible. Just put the elements in a collection, and modify the element at whichever index value you want. For example, assume you declared your element collection as "elements", and you wanted to use the fourth element, it would be something like elements(3).Invokemember("click").
 
Back
Top