Luke101 Posted July 19, 2012 Share Posted July 19, 2012 (edited) How would I click a radio button in an iframe. Here is the code for the iframe. The Iframe content is loaded by ajax <IFRAME style="WIDTH: 100%; HEIGHT: 100%" id=DialogIframe src="/aveksa/main?ReqType=Dialog&TableID=ActivityByWorkitemTable&Action=Content&PageNum=1&isAjax=true&PageID=WorkflowWorkItemPageData&icon=changeRequest.gif&Oid=2346%3AWPDS%3A1&ObjectClass=com.aveksa.gui.objects.workflow.GuiWorkflowWorkItem&PageSubTab=WorkItemMainPageData" frameBorder=0 name=DialogIframe></IFRAME> here is an exmple of the radio: <INPUT type="radio" name="nodeUserData_acm.trans.script.value" id="nodeUserData_acm.trans.script.valueCanceled" class="InputValueFld" style='white-space:nowrap;margin-left:0px;margin-right:5px;_margin-right:0px;width:13pxheight:13px;cursor:pointer' value="Canceled" onClick="changeState(this)" /> Edited July 19, 2012 by Luke101 Link to comment Share on other sites More sharing options...
MrMitchell Posted July 20, 2012 Share Posted July 20, 2012 What code have you got so far? You can try _IEFormElementRadioSelect() Link to comment Share on other sites More sharing options...
DaleHohm Posted July 20, 2012 Share Posted July 20, 2012 What code have you got so far? You can try _IEFormElementRadioSelect()Preceded by one of the _IEFrameGet*() functions so that you can drill into it.Dale 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...
Luke101 Posted July 20, 2012 Author Share Posted July 20, 2012 (edited) here is the code I have so far but it does not work: _IENavigate($oIE, $url1]) Sleep(500) $theFrame = _IEFrameGetCollection($oIE, 2) $oForm1 = _IEFormGetObjByName($oIE, "WorkItemForm") _IEFormElementRadioSelect($oForm1, 1, "Canceled", 1, "byIndex") Edited July 20, 2012 by Luke101 Link to comment Share on other sites More sharing options...
MrMitchell Posted July 20, 2012 Share Posted July 20, 2012 Preceded by one of the _IEFrameGet*() functions so that you can drill into it.DaleQuick question: If _IEFormElementRadioSelect() only works on Forms, according to the Help File, what good does it do to get a reference to the Frame? Or are they interchangeable? Just wondering...discrepancies like this have already come up a couple times recently... like in thread where you can use _IELinkClickByText() with a Form object even though Help File didn't mention you could. Link to comment Share on other sites More sharing options...
DaleHohm Posted July 23, 2012 Share Posted July 23, 2012 There is no discrepancy - here or in the other thread you mention. That other thread contains a false conclusion. In general, frame objects ($oFrame) and InternetExplorer.Application objects ($oIE) can be used interchanably and it is stated as such in each place it applies in the documentation. Dale 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...
MrMitchell Posted July 23, 2012 Share Posted July 23, 2012 In general, frame objects ($oFrame) and InternetExplorer.Application objects ($oIE) can be used interchanably and it is stated as such in each place it applies in the documentation.DaleI appreciate you helping to clear it up but I'm still confused... plain and simple the Help File states the first parameter for _IEFormElementRadioSelect(), $o_object, needs to be "Object variable of an InternetExplorer.Application, Form object" which I read as it can be either or. No where that I can see does it say you can use a Frame object instead of an Application object. If this applies to this function, why don't I see it? Other functions, like _IEDocReadHTML() say specifically you can supply an IE Application, Window or Frame.Let me put it another way... If this was my first day using IE Functions, where exactly would I stumble upon the fact that I could use a Frame instead of Application for this or any other function it applies to if it isn't already specifically stated such as in the _IEDocReadHTML example I just noted above?Again..thank you very much for taking the time to point me in the right direction Link to comment Share on other sites More sharing options...
DaleHohm Posted July 23, 2012 Share Posted July 23, 2012 The documentation you are referring to is, in fact, trying to be too precise. It should simply state that the first parameter must be a Form object. Dale 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...
Attckdog Posted July 23, 2012 Share Posted July 23, 2012 Just because no one else asked; is the Form collection returning the correct form that contains the element you're after? also can you post the HTML of what you are trying to interact with? A true renaissance man Link to comment Share on other sites More sharing options...
Luke101 Posted July 31, 2012 Author Share Posted July 31, 2012 Hi I have solved this issue with this code: _IENavigate($oIE, $url") $o_frame = _IEFrameGetCollection($oIE, 1) $actionInput = _IEGetObjById($o_frame, $actionId) _IEAction($actionInput, "click") $comment = _IEGetObjById($o_frame, "comment") $comment.value = $performMessage 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