in reply to Re: How to use IEAutomation with iframes?
in thread How to use IEAutomation with iframes?

Hi,

Thanks, I used CSS in Selenium and that worked OK - except for the intermittent cannot find element error (which is something to do with frames too I believe), but IEAutomation doesn't seem to support the use of CSS.

It just so happens the first frame sFrame has both an 'id' and 'name' attribute that are both the same. Using the 'name' to locate the frame seems to work, using id does not - it led me to wonder was there a bug in the IEAutomation code - I looked at the source but the id and name functions looked so similar. The second child frame only has an 'id' so I can't avoid using it.

Using 'id' for the image element seems to work ok.

I don't control the site unfortunately so can't make the changes.

So I'm a bit stuck.

Replies are listed 'Best First'.
Re^3: How to use IEAutomation with iframes?
by zerocred (Beadle) on Mar 13, 2010 at 10:36 UTC

    Following up on the id & name locators, I found this on w3.org site:

    "12.2.3 Anchors with the id attribute
    ...
    The id and name attributes share the same name space. This means that they cannot both define an anchor with the same name in the same document. It is permissible to use both attributes to specify an element's unique identifier for the following elements: A, APPLET, FORM, FRAME, IFRAME, IMG, and MAP. When both attributes are used on a single element, their values must be identical."

    I tried using 'name:' instead of 'id:' and it fails if there is no name attribute. So they don't seem interchangeable.
      Further investigation reveals that the iframe source is loaded from another URL which I think is not loaded by IEAutomation - thus IEA cannot find the contents of the first iframe...

      But then, the iframe contents show up on the IE screen... hmmm so it must be there...somewhere

      I need mroe sleep.
        Yeah right

      Using the URL of the relevant iframe as the IEAutomation source URL I can identify and fill in the account name textbox with this snippet:

      $ie->getTextBox('name:', "account")->SetValue($user)

      Still need to figure out how to locate it from the parent iframes...