yomamasdad Posted June 30, 2014 Share Posted June 30, 2014 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 More sharing options...
JohnOne Posted June 30, 2014 Share Posted June 30, 2014 A frame from another domain will have the address of that other domain. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
yomamasdad Posted June 30, 2014 Author Share Posted June 30, 2014 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" Link to comment Share on other sites More sharing options...
JohnOne Posted June 30, 2014 Share Posted June 30, 2014 And the others, including the website actual? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
yomamasdad Posted June 30, 2014 Author Share Posted June 30, 2014 (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 June 30, 2014 by yomamasdad Link to comment Share on other sites More sharing options...
JohnOne Posted June 30, 2014 Share Posted June 30, 2014 To operate on that frame you will have to navigate to it. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
yomamasdad Posted June 30, 2014 Author Share Posted June 30, 2014 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 More sharing options...
Solution JohnOne Posted June 30, 2014 Solution Share Posted June 30, 2014 IsObj($oObj) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Danp2 Posted June 30, 2014 Share Posted June 30, 2014 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. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
yomamasdad Posted June 30, 2014 Author Share Posted June 30, 2014 (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 June 30, 2014 by yomamasdad Link to comment Share on other sites More sharing options...
JohnOne Posted June 30, 2014 Share Posted June 30, 2014 What is the "name" of that frame? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
yomamasdad Posted June 30, 2014 Author Share Posted June 30, 2014 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 More sharing options...
yomamasdad Posted June 30, 2014 Author Share Posted June 30, 2014 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 More sharing options...
JohnOne Posted June 30, 2014 Share Posted June 30, 2014 Because that form is within the cross domain frame? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
yomamasdad Posted July 2, 2014 Author Share Posted July 2, 2014 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now