Finding the *second* instance of a particular object
Hi all,
Right now I've got this piece of code to reference the element ID of an HTML Div with the CssText property beginning with "OVERFLOW":
elementID = HTMLDiv("CssText=OVERFLOW*").elementID
Now I'm in a situation where I want the SECOND occurence of this lookup. I can't seem to find a way to do this, anyone know?
Thx!!
Scott.
Re: Finding the *second* instance of a particular object
Could you post a bit more of your code to put this one line in context?
Re: Finding the *second* instance of a particular object
Sure, I'll explain more what's going on as well.
In my web application a certain action will create (via ExtJS) additional instances of the particular Div section I'm after. Searching for them using their elementIDs is not an option, as there is no consistency in terms of what elementID number is generated. The only quality that makes them distinct from other Divs within the application page is the CssText field ("OVERFLOW").
The first action I perform, there's no issue since there is only one of the relevant Divs on the page. But the 2nd time I perform it, there are TWO of these "OVERFLOW" Divs, and I need to capture the second instance. However, the line in blue below seems to only ever return the 1st instance.
Dim elemToClick As Integer
Window("Internet Explorer Window").Attach
Set tbl = HTMLTable("FirstCellText='" & optionName & "'")
Set td = tbl.GetCell(1, 2)
td.Click
elementID = HTMLDiv("CssText=OVERFLOW*").elementID
elemToClick = elementID + order + 1
HTMLDiv("ElementID=" & CStr(elemToClick)).Click 88, 14
Thx again,
Scott.