Sign in to follow this  
Followers 0
yomamasdad

IE iFrame element help

15 posts in this topic

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.

Share this post


Link to post
Share on other sites



I'm not sure of what it is in this case. The source of one the the frames is something like this :"domain.aspx?sassion=3922j3jkuu4-2dfe-fyem39df558594"

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Any time one of the _IE commands fail, you should see an indication of such in the Scite Output window.

Run your code in Scite and post the Output window results.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Yes, I believe so.

Thus, leading to the conclusion that I can't access it due to cross domain access issues.

Thanks for all of the help you guys took your time to contribute.

Share this post


Link to post
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
Sign in to follow this  
Followers 0