Sign in to follow this  
Followers 0
JaySquared

Another IE automation topic

15 posts in this topic

I've done quite a bit of automation at work, so my boss handed me a project. The only thing is, the source code doesn't give me anything to work with.

Using IE Builder 2.0 Here is what I've gleaned

Source:

<FRAME id=idFrameBanner src="../Banner.asp" frameBorder=0 noResize scrolling=no>

<FRAME id=idFrameHeader src="../Header.asp?CustomerType=Company&CustomerId=&OwnerType=Customer&CustomerInvalid=0&CustomerSecondaryId=&FirstTime=1" frameBorder=0 noResize scrolling=no>

<FRAMESET id=idFrameMainBody border=0 onbeforeunload=vb script:jsMainonload() cols=125,0,0,0,*,0,0 onunload=vb script:vbonunload()>

<FRAME id=idFrameNavBar name=idFrameNavBar src="../NavBar/navigation_bar.htm" frameBorder=0 noResize scrolling=no>

<FRAME id=idFrameSearch name=idFrameSearchBar src="../QuickSearch/search.asp?WindowType=MODELESS&SearchType=CUSTOMER&Action=CUSTOMERINCIDENTSEARCH" frameBorder=0 noResize scrolling=no>

<FRAME id=idFrameCRM name=idFrameCRM src="../Main.asp" frameBorder=0 noResize>

<FRAME id=idFrameTM name=idFrameTMBar src="../blank.htm" frameBorder=0 noResize scrolling=no>

<FRAME id=idFrameHP name=idFrameHomePage src="../homepage/hp_main.asp" frameBorder=0 noResize scrolling=no>

<FRAME id=idFrameNonCustomer name=idFrameNonCustomer src="../blank.htm" frameBorder=0 noResize>

<FRAME id=idFrameLostServer name=idFrameLostServer src="../lostserver.htm" frameBorder=0 noResize>

</FRAMESET>

<FRAME id=idFrameOEPAutomate name=idFrameOEPAutomate src="../blank.htm" frameBorder=0 noResize scrolling=no>

71 Object Elements

45 are listed as "Script"

10 are listed as just "!"

No Anchor Tags

No Image Tags

0 Form Elements

Anyone have any ideas how I can do automation on something like this?


Aha.. I have unlocked it's secrets.. world domination is within my grasp...

Share this post


Link to post
Share on other sites



What are you wanting to automate?


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Various things such as input, navigation, etc.


Aha.. I have unlocked it's secrets.. world domination is within my grasp...

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Here is a screen shot that will give you an idea of the layout, however all private data has been removed. I need to be able to switch tabs, fill in forms, etc. I've had success doing this on other sites, however this one is giving me trouble.

One big for example is I need to be able to select Support tab down near the bottom.

Edited by JaySquared

Aha.. I have unlocked it's secrets.. world domination is within my grasp...

Share this post


Link to post
Share on other sites

Here is a screen shot that will give you an idea of the layout, however all private data has been removed. I need to be able to switch tabs, fill in forms, etc. I've had success doing this on other sites, however this one is giving me trouble.

One big for example is I need to be able to select Support tab down near the bottom.

Your first challenge is going to be to drill down to the Frame that contains the content you want to work with . See _IEFrame*

Once you find that, in the case of the support tab, there is likely to be a <div> tag taht represents the tab with an onclick Javascript event tied to it. You'll need to get a reference to the correct div (e.g. with _IEGetObjByName) and then use _IEAction($oDiv, "click")

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

Share this post


Link to post
Share on other sites

Ok.. I've been drilling like an oil rigger (61 pages of code to bring up the one webpage), hunting thru code, looking thru Dale's example pages and can't figure out how to access these fields. Here's the HTML for the first frame I'm trying to manipulate.

<DIV id=divMain><!----------------------------- TOOLBAR PANE ----------------------->
<DIV id=divError style="DISPLAY: none"> </DIV><!----------------------------- CRITERIA PANE ----------------------->
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD colSpan=2><SPAN class=clsSearchHeader id=spanSearchTitle style="DISPLAY: inline"> Search</SPAN> <SPAN class=clsSearchHeader id=spanMergeTitle style="DISPLAY: none">Merge Customers</SPAN> </TD></TR>
<TR>
<TD colSpan=2>
<DIV id=div_tabview style="VISIBILITY: visible">
<TABLE id=div_tabview_tblTabs style="WIDTH: 100%" cellSpacing=0 cellPadding=0 border=0 xmlns:tabDef="http://www.onyx.com/oep/tabdef4.5">
<TBODY>
<TR>
<TD id=div_tabview_tdTabs style="WIDTH: 600px">
<DIV id=div_tabview_divTabsInnerContainer style="MARGIN-TOP: 10px; OVERFLOW: hidden; WIDTH: 600px" noWrap><SPAN id=div_tabview_customer tabId="customer" fireonclick="jsTabChange('CUSTOMER')"><IMG src="../onyxcommon/tabcontrol/images/leftactive.gif" align=absMiddle><SPAN class=clsActiveTab style="PADDING-RIGHT: 10px"><SPAN class=clsActiveTab>Customer</SPAN></SPAN><IMG src="../onyxcommon/tabcontrol/images/rightactive.gif" align=absMiddle></SPAN><SPAN id=div_tabview_incident tabId="incident" fireonclick="jsTabChange('INCIDENT')"><IMG src="http://membership/membership/onyxcommon/tabcontrol/images/leftinactive.gif" align=absMiddle><SPAN class=clsInactiveTab style="PADDING-RIGHT: 10px"><SPAN class=clsInactiveTab>Incident</SPAN></SPAN><IMG src="http://membership/membership/onyxcommon/tabcontrol/images/rightinactive.gif" align=absMiddle></SPAN><SPAN id=div_tabview_workticket tabId="workticket" fireonclick="jsTabChange('WORKTICKET')"><IMG src="http://membership/membership/onyxcommon/tabcontrol/images/leftinactive.gif" align=absMiddle><SPAN class=clsInactiveTab style="PADDING-RIGHT: 10px"><SPAN class=clsInactiveTab>Work Ticket</SPAN></SPAN><IMG src="http://membership/membership/onyxcommon/tabcontrol/images/rightinactive.gif" align=absMiddle></SPAN><SPAN id=div_tabview_pharmacy tabId="pharmacy" fireonclick="jsTabChange('PHARMACY')"><IMG src="http://membership/membership/onyxcommon/tabcontrol/images/leftinactive.gif" align=absMiddle><SPAN class=clsInactiveTab style="PADDING-RIGHT: 10px"><SPAN class=clsInactiveTab>Pharmacy</SPAN></SPAN><IMG src="http://membership/membership/onyxcommon/tabcontrol/images/rightinactive.gif" align=absMiddle></SPAN></DIV></TD>
<TD id=div_tabview_tdScrollers style="WIDTH: 30px">
<TABLE>
<TBODY>
<TR>
<TD style="WIDTH: 14px" align=middle><IMG id=div_tabview_imgScrollLeft style="DISPLAY: none; CURSOR: hand" height=13 alt="Scroll Left" src="../onyxcommon/tabcontrol/images/inactivescrollleft.gif" width=10></TD>
<TD style="WIDTH: 14px" align=middle><IMG id=div_tabview_imgScrollRight style="DISPLAY: none; CURSOR: hand" height=13 alt="Scroll Right" src="../onyxcommon/tabcontrol/images/inactivescrollright.gif" width=10></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></TD></TR>
<TR class=clsTabToolbar><!--CSBeginMod:Onyx.AugustineA:08.10.2004--><!--<td>-->
<TD align=left><!--CSEndMod:Onyx.AugustineA:08.10.2004--></TD>
<TD vAlign=center noWrap align=right height=25><SPAN><IMG onmouseup=java script:jsRollover(this) class=mouse onmousedown=java script:jsRollover(this) id=iconFind onmouseover=java script:jsRollover(this) title="Run Search" style="DISPLAY: inline" onclick=java script:jsRunSearch() onmouseout=java script:jsRollover(this) height=22 src="../images/icons/iconfind0.gif" width=23 border=0> </SPAN><SPAN><IMG onmouseup=java script:jsRollover(this) class=mouse onmousedown=java script:jsRollover(this) id=iconErase onmouseover=java script:jsRollover(this) title="Clear Criteria" style="DISPLAY: inline" onclick=java script:jsClearCriteria() onmouseout=java script:jsRollover(this) height=22 src="../images/icons/iconerase0.gif" width=23 border=0> </SPAN><SPAN><IMG onmouseup=java script:jsRollover(this) class=mouse onmousedown=java script:jsRollover(this) id=iconAddCustomer onmouseover=java script:jsRollover(this) title="Add Individual" onclick=doAdd() onmouseout=java script:jsRollover(this) height=22 src="../images/icons/iconadd0.gif" width=23 border=0> </SPAN><SPAN id=idCellSave style="DISPLAY: none"><SPAN><IMG onmouseup=java script:jsRollover(this) class=mouse onmousedown=java script:jsRollover(this) id=iconSave onmouseover=java script:jsRollover(this) title="Merge Selected Items" onclick=java script:jsProcessAction() onmouseout=java script:jsRollover(this) height=22 src="../images/icons/iconsave0.gif" width=23 border=0> </SPAN></SPAN>
<DIV id=divExpand style="DISPLAY: none"><SPAN><IMG onmouseup=java script:jsRollover(this) class=mouse onmousedown=java script:jsRollover(this) id=iconExpand onmouseover=java script:jsRollover(this) title="Expand/Contract Criteria" onclick=java script:jsShowCriteria(!mbShowCriteria) onmouseout=java script:jsRollover(this) height=22 src="../images/icons/iconarrowdown0.gif" width=23 border=0> </SPAN></DIV>
<DIV id=divContract style="DISPLAY: inline"><SPAN><IMG onmouseup=java script:jsRollover(this) class=mouse onmousedown=java script:jsRollover(this) id=iconContract onmouseover=java script:jsRollover(this) title="Expand/Contract Criteria" onclick=java script:jsShowCriteria(!mbShowCriteria) onmouseout=java script:jsRollover(this) height=22 src="../images/icons/iconarrowup0.gif" width=23 border=0> </SPAN></DIV>  </TD></TR></TBODY></TABLE>
<DIV class=bodyHeader id=divCriteria style="MARGIN-TOP: 0px"><!----------------------------- CUSTOMER CRITERIA ----------------------->
<DIV id=divCustomerTerms style="DISPLAY: block">
<TABLE cellSpacing=1 cellPadding=1 border=0>
<TBODY>
<TR>
<TD align=right>ID</TD>
<TD><INPUT onkeypress="" id=txtSecondaryCustomerId tabIndex=1 maxLength=10 size=12 name=txtSecondaryCustomerId></TD>
<TD align=right></TD>
<TD><INPUT onkeypress=jsCustomerTypeClick(this) id=chkCompany onclick=jsCustomerTypeClick(this) tabIndex=2 type=checkbox CHECKED name=chkCompany>Company<INPUT onkeypress=jsCustomerTypeClick(this) id=chkIndividual onclick=jsCustomerTypeClick(this) tabIndex=3 type=checkbox name=chkIndividual>Individual </TD></TR>
<TR>
<TD align=right>First Name</TD>
<TD><INPUT onkeypress=vbCheckIndividual() id=txtFirstName tabIndex=4 maxLength=255 size=30 name=txtFirstName></TD>
<TD align=right>Last Name</TD>
<TD><INPUT onkeypress=vbCheckIndividual() id=txtLastName tabIndex=5 maxLength=255 size=30 name=txtLastName></TD></TR>
<TR>
<TD align=right>Company Name</TD>
<TD><INPUT id=txtCompanyName tabIndex=6 maxLength=255 size=30 name=txtCompanyName></TD>
<TD align=right>Phone</TD>

It appears to be in a table, not DIV tags and it's not in a form. Since it's not in a form, how do I access the INPUT?


Aha.. I have unlocked it's secrets.. world domination is within my grasp...

Share this post


Link to post
Share on other sites

You can use _IETagNameGetCollection($oIE, "input", zero-based-index-of-input-field-you-want)

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

Share this post


Link to post
Share on other sites

By "zero-based-index-of-input-field-you-want" do you mean 0 would equal whatever Input is listed first etc so that I need to go by number reference instead of by name?


Aha.. I have unlocked it's secrets.. world domination is within my grasp...

Share this post


Link to post
Share on other sites

By "zero-based-index-of-input-field-you-want" do you mean 0 would equal whatever Input is listed first etc so that I need to go by number reference instead of by name?

Yes, that is what I meant, but if they have names you can use _IEGetObjByName

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

Share this post


Link to post
Share on other sites

@Dale

I would just like to extend to you my gratitude for your patience with me and everyone else here. While I have seen your assistance numerous times to those who haven't "gotten it" your assistance did help me not only unlock what I was missing, but also a better understanding of how IE.au3 can work. Hopefully I will be able to help others in turn.

:whistle:


Aha.. I have unlocked it's secrets.. world domination is within my grasp...

Share this post


Link to post
Share on other sites

@Dale

I would just like to extend to you my gratitude for your patience with me and everyone else here. While I have seen your assistance numerous times to those who haven't "gotten it" your assistance did help me not only unlock what I was missing, but also a better understanding of how IE.au3 can work. Hopefully I will be able to help others in turn.

:whistle:

You're welcome. I have lots of patience with anyone who is trying to learn. And yes, the best way to show your gratitude is by jumping in whenever you can to help others with IE.au3.

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

Share this post


Link to post
Share on other sites

Still learning..

I can navigate the frames, pull out the id's and such but I have one section that is giving me hell.

$oFrame = _IEFrameGetObjByName($oIE, "idFrameCRM")
$oSubFrame = _IEFrameGetObjByName($oFrame, "frmTabs")
$Support = _IEGetObjByName($oSubFrame,"iddiv_tabview_support")
$Support.click

It errors out that $Support is not an object. Now I have done the same thing with another icon and it clicked fine. Here is the original HTML code

<DIV id=iddiv_tabview_divTabsInnerContainer style="MARGIN-TOP: 10px; OVERFLOW: hidden; WIDTH: 631px" noWrap>
<SPAN id=iddiv_tabview_support tabId="support" fireonclick="doTabClick('SUPPORT')"><IMG src="http://membership/membership/onyxcommon/tabcontrol/images/leftinactive.gif" align=absMiddle>

What am I doing wrong?


Aha.. I have unlocked it's secrets.. world domination is within my grasp...

Share this post


Link to post
Share on other sites

Still learning..

I can navigate the frames, pull out the id's and such but I have one section that is giving me hell.

$oFrame = _IEFrameGetObjByName($oIE, "idFrameCRM")
$oSubFrame = _IEFrameGetObjByName($oFrame, "frmTabs")
$Support = _IEGetObjByName($oSubFrame,"iddiv_tabview_support")
$Support.click

It errors out that $Support is not an object. Now I have done the same thing with another icon and it clicked fine. Here is the original HTML code

<DIV id=iddiv_tabview_divTabsInnerContainer style="MARGIN-TOP: 10px; OVERFLOW: hidden; WIDTH: 631px" noWrap>
<SPAN id=iddiv_tabview_support tabId="support" fireonclick="doTabClick('SUPPORT')"><IMG src="http://membership/membership/onyxcommon/tabcontrol/images/leftinactive.gif" align=absMiddle>

What am I doing wrong?

Based on what you are saying, I'd expect _IEGetObjByName($oSubFrame,"iddiv_tabview_support") to give you a NOMATCH error in the SciTe console -- it is not?

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

Share this post


Link to post
Share on other sites

--> IE.au3 Warning from function _IEGetObjByName, $_IEStatus_NoMatch

C:\Documents and Settings\jperry\Desktop\Macros\Testing\SpendLocator.au3 (27) : ==> Variable must be of type "Object".:

$Support.click

$Support^ ERROR

+>AutoIT3.exe ended.rc:0


Aha.. I have unlocked it's secrets.. world domination is within my grasp...

Share this post


Link to post
Share on other sites

So I have to state the obvious, please don't ignore the messages sent to the console. The more significant message is the no match, rather than the object error.

I suggest you examine the contents of $oSubFrame with _IEDocReadHTML because I don't think it contains what you think it does.

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0