Jump to content

Need to get into an IE frame.


Recommended Posts

#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)

MsgBox(0, "Frame Info", _IEPropertyGet ($oFrame, "outerText"))

Next

EndIf

So 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

post-37941-0-14919100-1339601299_thumb.j

Link to comment
Share on other sites

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 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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...