Armis Posted January 7, 2008 Share Posted January 7, 2008 Hi there,Looks like i'm not able to access any form object in a specific Internet Explorer Frame. In the test which follows, i'm trying to display two "GOOGLE.COM" pages, one in my left frame and the other in my right frame. When this is loaded, i want to set the text of the search field to "test". Pretty simple...Here is my HTML file where my frames are createdThe file's name is "test.html" and is located on my desktop.<frameset cols="50%,50%"> <frame src="http://www.google.com" name="left"> <frame src="http://www.google.com" name="right"> </frameset>Here is my AutoIt code#include <IE.au3>$oIE = _IECreate("about:blank")_IENavigate($oIE, "C:\Documents and Settings\mahatch\Bureau\test.html")$oLeftFrame = _IEFrameGetObjByName($oIE, "left"); Google form name = "f" / Google query field name = "q"$oForm = _IEFormGetObjByName($oLeftFrame, "f")$oField = _IEFormGetObjByName($oForm, "q")_IEFormElementSetValue($oField, "test")All this is very simple but i'm just not able to find out what the problem could be. This is just not working at all. I'm also receiving an error message. Here it is:$o_col = $o_object.document.forms.item ($s_Name)$o_col = $o_object.document^ ERRORError: The requested action whit this object has failed. Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 8, 2008 Share Posted January 8, 2008 If I recall correctly you invoke security measures against cross-site scripting when you try to do different things in each frame. It's a feature, not a bug... Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
DaleHohm Posted January 8, 2008 Share Posted January 8, 2008 (edited) If you add this to your script: _IEErrorHandlerRegister() I expect you'll see an "Access is denied." COM error. This is called cross-site scripting of frames and is a security restriction (the parent document is about:blank which is not in the domain with google). As nice as this would be, you cannot automate IE this way. Dale Edit: didn't notice that PsaltyDS has replied while I was ignoring the open reply in my browser :-) Edited January 8, 2008 by DaleHohm Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
Armis Posted January 8, 2008 Author Share Posted January 8, 2008 Well, Thank-you for your replys guys! I'll try to figure out an other way to do what I was trying to do. And there is no way to bypass this cross-site security? What i'm trying to do is simple. I'm trying to deploy a software on some computers. To configure the webapp i need to browse some links and some buttons in a specific frame since the webapp is using two frames. There is no way to bypass this security? Thanks! - Armis - Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 8, 2008 Share Posted January 8, 2008 There is no way to bypass this security?If there is, it won't be discussed on this forum...The primary purpose of maliciously bypassing security is USUALLY to "deploy a software on some computers". Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Armis Posted January 8, 2008 Author Share Posted January 8, 2008 Yes you're right, But anyway I figured out an other way to set up my application correctly. I have been able to get the localhost webapp address and went on the desired page directly whitout going through the left frame. That way I bypassed this frame security issue and was now able to work perfectly whit all the object in it. Thanks for your help guys Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 8, 2008 Share Posted January 8, 2008 But anyway I figured out an other way to set up my application correctly. I have been able to get the localhost webapp address and went on the desired page directly whitout going through the left frame. That way I bypassed this frame security issue and was now able to work perfectly whit all the object in it.Glad you figured it out. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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