OrthodoxyUSA Posted June 13, 2012 Share Posted June 13, 2012 #include <IE.au3>Opt("WinTitleMatchMode", 2)If WinExists("SF CRM") Then WinActivate("SF CRM")$oIE = _IEAttach("SF CRM")$oFrames = _IEFrameGetCollection ($oIE)$iNumFrames = @extendedFor $i = 0 to ($iNumFrames - 1) $oFrame = _IEFrameGetCollection ($oIE, $i) MsgBox(0, "Frame Info", _IEPropertyGet ($oFrame, "outerText"))NextEndIfSo this gets me the list of different frames in my open IE.The "button" I need to click is not in the 'default' frame._IEPropertyGet ($oFrame, "outerText") returns "Customer Service - Home" as one of the frames. I believe this is the one I need to get focused on in order to use "_IELinkClickByIndex" to open a specific function.So how do I get into a specifc frame?Paul Link to comment Share on other sites More sharing options...
jdelaney Posted June 13, 2012 Share Posted June 13, 2012 (edited) For $oFrame In $oFrames MsgBox(0, "Frame Info", _IEPropertyGet ($oFrame, "outerText")) Next switch your loop with the above...you can also use $oFrame.outertext Inside the loop, you will need to do some logic to check if you are in the proper frame node, and if you are, exit the loop, and proceed with $oFrame to drill into it, and find your specific link. Edited June 13, 2012 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
OrthodoxyUSA Posted June 14, 2012 Author Share Posted June 14, 2012 For $oFrame In $oFrames MsgBox(0, "Frame Info", _IEPropertyGet ($oFrame, "outerText")) Next switch your loop with the above...you can also use $oFrame.outertext Inside the loop, you will need to do some logic to check if you are in the proper frame node, and if you are, exit the loop, and proceed with $oFrame to drill into it, and find your specific link. Never could get the "For" loop to work. Here is what became my final solution. Not really sure I understand why one works and the other doesn't. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=CRM.ico #AutoIt3Wrapper_Outfile=CRM.exe #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Res_Fileversion=1.1.0.0 #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <IE.au3> Opt("WinTitleMatchMode", 2) If WinExists("SF CRM") Then WinActivate("SF CRM") $oIE = _IEAttach("SF CRM") $oFrames = _IEFrameGetCollection ($oIE) $iNumFrames = @extended For $i = 0 to ($iNumFrames - 1) $oFrame = _IEFrameGetCollection ($oIE, $i) _IELinkClickByText($oFrame,"Create Item") _IELinkClickByText($oIE,"More") _IELinkClickByText($oIE,"Tickets") ExitLoop Next Else $oIE = _IECreate("http://crm-app.csa1.com/trackweb/TrackWeb.asp", 1) _IELoadWait($oIE) WinWaitActive("- SF CRM") $oIE = _IEAttach("- SF CRM") $oFrames = _IEFrameGetCollection ($oIE) $iNumFrames = @extended For $i = 0 to ($iNumFrames - 1) $oFrame = _IEFrameGetCollection ($oIE, $i) _IELinkClickByText($oFrame,"Create Item") _IELinkClickByText($oIE,"More") _IELinkClickByText($oIE,"Tickets") ExitLoop Next EndIf I also didn't understand why I had to change from $oFrame to $oIE after the first click from my "For" loop. (I'm just happy it works, I didn't think I would ever get to that button.) Paul Link to comment Share on other sites More sharing options...
ileandros Posted June 14, 2012 Share Posted June 14, 2012 Can u provide the s code? I feel nothing.It feels great. 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