Results 1 to 3 of 3

Thread: Finding the *second* instance of a particular object

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2009
    Posts
    2

    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.

  2. #2
    Frenzied Member
    Join Date
    Apr 2009
    Location
    CA, USA
    Posts
    1,516

    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?

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2009
    Posts
    2

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width