Jump to content

IE iFrame element help


Go to solution Solved by JohnOne,

Recommended Posts

Hello, 

I am having issues accessing a button that I want to press. It is nested in several forms and iframes.

I have exhausted most of the forum posts and nothing seems to work.

This is what I currently have, trying to select the button through the layers;

Local $oForm = _IEFormGetObjByName($o_IE, "ServerForm")
Local $oFrame = _IEFrameGetObjByName($oForm, "UserHomeFrame")
Local $oForm1 = _IEFormGetObjByName($oFrame, "aspnetForm")
Local $oFrame1 = _IEFrameGetObjByName($oForm1, "TabContent")
Local $oForm2 = _IEFormGetObjByName($oFrame1, "DomainMainForm")
Local $oFrame2 = _IEFrameGetObjByName($oForm2,"TabContent")
Local $oForm3 = _IEFormGetObjByName($oFrame2, "form1")
Local $oInput = _IEFormElementGetObjByName($oForm3, "NewDomainButton")
_IEAction($oInput, "click")

The hierarchy seems to be correct, as I have checked to ensure that all of the nested iframes and forms were included.

I have also tried to open the contents of the iframe in another window but the content is not visible when opened.

Also, how do I check if the iframe is from another domain? I have read that the IE dom doesn't allow traversing through a cross domain due to security issues(making my goal harder to reach).

Thanks in advance.

Link to comment
Share on other sites

The other frames do not seem to have any src attributes. The actual looks like "http://(ip)/theodrive/default.ashx"

The webhost is on the local network and uses a sql server on the same vm. 

Oh, and for what it's worth, your Autoit absolute beginners guide me helped me a lot to get started, so thanks for that.

Edited by yomamasdad
Link to comment
Share on other sites

Starting from the IE instance itself, I have tried to get down to the form containing the button.

 From there I tried to click it using the code below

Local $oForm = _IEFormGetObjByName($o_IE, "ServerForm")
Local $oFrame = _IEFrameGetObjByName($oForm, "UserHomeFrame")
Local $oForm1 = _IEFormGetObjByName($oFrame, "aspnetForm")
Local $oFrame1 = _IEFrameGetObjByName($oForm1, "TabContent")
Local $oForm2 = _IEFormGetObjByName($oFrame1, "DomainMainForm")
Local $oFrame2 = _IEFrameGetObjByName($oForm2,"TabContent")
Local $oForm3 = _IEFormGetObjByName($oFrame2, "form1")
Local $oInput = _IEFormElementGetObjByName($oForm3, "NewDomainButton")
_IEAction($oInput, "click")

Is there a way to show if getting a handler for a certain form or iframe has either succeeded or failed? It would be easier for me to troubleshoot that way.

Link to comment
Share on other sites

Thank you for the suggestions. I've tried some tests. Unfortunately, the script is failing to find the first iFrame within the $oForm;

<iframe id="UserHomeFrame" src="theohome.aspx?SessionContainer=23fcew9ee-1bf8-ebr83-4-7fesw55c311">

I've read that _IEFrameGetObjByName doesn't differentiate between name and id so I thought the second line would be fine but Scite says:

--> IE.au3 T3.0-1 Warning from function _IEFrameGetObjByName, $_IESTATUS_NoMatch (No frames matching name)
--> IE.au3 T3.0-1 Error from function _IEFormGetObjByName, $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-1 Error from function _IEFrameGetObjByName, $_IESTATUS_InvalidDataType
Edited by yomamasdad
Link to comment
Share on other sites

It doesn't have a name attribute. However, I could use _IEGetObjById to fine it.

The information stating that _IEFrameGetObjByName could recognize id as well might be wrong after all.

I am working through the list and will get back to you guys asap.

Link to comment
Share on other sites

I have hit another snag.

This time, the problem is with $oForm1;

<form name="aspnetForm" id="aspnetForm" onkeypress="javascript:return WebForm_FireDefaultButton(event, 'ctl00_DoNothingButton')" action="ThoeHome.aspx?SessionDataContainer=60123ec5-29d2-12s8d-84dc-a62d8edefe6" method="post">

I tried getting the handler to the above using

Local $oForm1 = _IEFormGetObjByName($oFrame, "aspnetForm")

Scite is giving me the nomatch error of 

--> IE.au3 T3.0-1 Warning from function _IEFormGetObjByName, $_IESTATUS_NoMatch
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...