dushkin Posted July 21, 2010 Share Posted July 21, 2010 Hi All, I need to press a button in a web site which is built with java script, yahoo framework, CSS and Ajax. The button is definitely not a simple html button. Using the IE8 developer tools "Find control" facility I got the to the following line in the, probably, server code created line: <td title="Raise Hand" class="toolbarButtonEmoticon13" id="IDS_WEBUI_BTN_RHAND" noWrap="nowrap" style="cursor: default; disabled: false;" onmouseover="OmBtnMouseOverEmoticon(this, document.getElementById('idEmoticonList'))" onmouseout="OmBtnMouseOutEmoticon(this, document.getElementById('idEmoticonList'))" onclick="g_oWPUIManager.oWPUIToolbarManager.onEmoticon(g_WPDefines.EMOTICON_BUTTON_ID)" enableState="13" state="13"> I tried to get the button object using many ways: _IE_GetObjByID, IE_GetObjByName, using the title, using the id, but I always got 0. I even tried _IEImgClick since there is an image on the button. Any help will be appreciated. Thanks! Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 21, 2010 Share Posted July 21, 2010 What is the full path to that TD tag? Is it inside a form, nested forms? In a frame? If you tried something like this: $oRaiseHand = _IEFormElementGetObjByName($oForm, "IDS_WEBUI_BTN_RHAND") What did you use for $oForm and how did you get it? Add _IEErrorHandlerRegister() and run it in SciTE to see the errors. If that page is loaded in a frame from another site, you see ACCESS DENIED due to cross-site scripting protection. 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...
dushkin Posted July 22, 2010 Author Share Posted July 22, 2010 (edited) I am really exhausted... I am attaching part of the HTML which is generated on the server. There is no form in the page. I need to click on the button with the title "RAISE_HAND" . It is inside the first td. I hope you can help me. Thanks! Edited July 22, 2010 by dushkin Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 22, 2010 Share Posted July 22, 2010 OK, there's no form. But you think the iFrame, FrameSet, Frame, relationship might be significant? You only posted a sliver of the source, so most of the ID attributes were not shown, but you have to: 1. Get the iFrame with $oIFrame = _IEFrameGetObjByName($oIE, "<put iFrame id here>") 2. Get the FrameSet under that with $oFrameset = _IEFrameGetObjByName($oIFrame, "<put frameset id here>") 3. Get the frame you want with $oFrame = _IEFrameGetObjByName($oFrameset, "frWP") 4. Now you can get the element you want with $oRaiseHand = _IEGetObjByName($oFrame, "IDS_WEBUI_BTN_RHAND") 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...
dushkin Posted July 25, 2010 Author Share Posted July 25, 2010 OK, there's no form. But you think the iFrame, FrameSet, Frame, relationship might be significant? You only posted a sliver of the source, so most of the ID attributes were not shown, but you have to:1. Get the iFrame with $oIFrame = _IEFrameGetObjByName($oIE, "<put iFrame id here>")2. Get the FrameSet under that with $oFrameset = _IEFrameGetObjByName($oIFrame, "<put frameset id here>")3. Get the frame you want with $oFrame = _IEFrameGetObjByName($oFrameset, "frWP")4. Now you can get the element you want with $oRaiseHand = _IEGetObjByName($oFrame, "IDS_WEBUI_BTN_RHAND")Dear Psalty, The general method you offered was the one I was thinking about. The problem is that I don't have an id or name attribute to the frameset and hence I am stuck. I do have for example onload, or others as you can see. Is there another way?Many thanks! Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 26, 2010 Share Posted July 26, 2010 You don't need a name. Use the 0-based index. For example, the first frameset (or frame) under $oIFrame would be _IEFrameGetCollection($oIFrame, 0). 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...
dushkin Posted July 27, 2010 Author Share Posted July 27, 2010 Thanks! It helped! 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