Sign in to follow this  
Followers 0
eric of here and there

Noob Needs A Little Assistance In Understanding Error.

12 posts in this topic

#1 ·  Posted (edited)

Edited by eric of here and there

Share this post


Link to post
Share on other sites



Might get a tad further throwing that in [ code] [ /code] tags (without spaces).

Makes the code easier to read.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

maybe you should take a look at my IE.au3 Builder

it gets all the info you want ( just like you are trying to do )

in my sig below

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Morning SmOke_N,

Thank you for the [ code] [ /code] pointer. I have modified my post per your suggestion.

Thanks,

-eric

Might get a tad further throwing that in [ code] [ /code] tags (without spaces).

Makes the code easier to read.

Edited by eric of here and there

Share this post


Link to post
Share on other sites

Hi Valuater. Thanks for the suggestion on the IE.au3 Builder. However, it can not seem to find any information on pages after the login. The source of that after login page shows this:

<FRAME title="Portal Header" name=header marginHeight=0 src="/servlets/iclientservlet/PSHPRD/?ICType=Script&amp;ICScriptProgramName=WEBLIB_MENU.ISCRIPT3.FieldFormula.IScript_GetMenuHeader" frameBorder=0 scrolling=no><FRAME title="Main Content" name=main marginHeight=0 src="/servlets/iclientservlet/PSHPRD/?ICType=Script&amp;ICScriptProgramName=WEBLIB_MENU.ISCRIPT3.FieldFormula.IScript_RedirectToDrillDown" frameBorder=0>

There were no "Form Elements", no "Image Tags", no "Anchor Tags", and only eight "HTML elements" listed. None of those eight "HTML elements" were the link, "Define Business Rules", I was suppose to click on next.

-- picture will go here after I get it posted --

Any suggestions of what I can do to get a handle on the items that show not show up in the builder?

maybe you should take a look at my IE.au3 Builder

it gets all the info you want ( just like you are trying to do )

in my sig below

8)

Share this post


Link to post
Share on other sites

You need to post the source from within the frame. What you posted is just the source for the "wrapper".

Share this post


Link to post
Share on other sites

Morning big_daddy,

How do you get the source from within the frame with Valuater's IE.au3 builder?

Thanks,

-eric

You need to post the source from within the frame. What you posted is just the source for the "wrapper".

Share this post


Link to post
Share on other sites

Morning big_daddy,

How do you get the source from within the frame with Valuater's IE.au3 builder?

Thanks,

-eric

I'm not sure if you can get the source for a frame from within IE Builder.

All you need to do is open IE go to the page right click (inside the frame)-->view source. Then just post what that gives you here.

Share this post


Link to post
Share on other sites

Good Morning big_daddy,

Thank you for that suggestion. I got the source code of the frame. Please teach me how to "fish" out the control ID, name, or any relevant information of the link or control that I can feed to functions such as controlclick. The one link in question I would like to simulate a click on is:

/servlets/iclientservlet/PSHPRD/?ICType=Script&ICScriptProgramName=WEBLIB_MENU.ISCRIPT3.FieldFormula.IScript_DrillDown&navc=1591&target=main0&RL=&menugroup=Define%20QQQBusiness%20Rules&Level=1&target=main0

What do I look for in the codes?

Thanks!

-eric

<HTML lang='en'>
<HEAD>

<script language='javascript' src='/servlets/cs/PSHPRD/cache/PT_PIAHDRSCRIPT_ENG_empty_1.js'></script><script language='javascript' src='/servlets/cs/PSHPRD/cache/PT_ISCROSSDOMAIN_ENG_empty_1.js'></script><script language='javascript' src='/servlets/cs/PSHPRD/cache/PT_SAVEWARNINGSCRIPT_ENG_empty_1.js'></script>
<TITLE></TITLE>
<script language='Javascript'>
var  totalTimeoutMilliseconds = 7200000; 
var  warningTimeoutMilliseconds = 7180000; 
var timeOutURL = 'http://hrms:7001/servlets/iclientservlet/PSHPRD/?cmd=expire';
var timeoutWarningPageURL = 'http://hrms:7001/servlets/iclientservlet/PSHPRD/?ICType=Script&ICScriptProgramName=WEBLIB_TIMEOUT.PT_TIMEOUTWARNING.FieldFormula.IScript_TIMEOUTWARNING';
</script> 

<LINK REL='STYLESHEET' TYPE='TEXT/CSS' HREF='/servlets/cs/PSHPRD/cache/PSSTYLEDEF_ENG_1.css'>
<STYLE TYPE="text/css">
A {
font-family: arial, helvetica, sans-serif;
font-weight: normal;
text-decoration: none;
color: #3333cc;
}
.levelDivider {
color: #999966;
margin-right: 3px;
margin-top: 3px;
margin-bottom: 3px;
}
</STYLE>
</HEAD>
 <BODY MARGINWIDTH="0" MARGINHEIGHT="0" TOPMARGIN="0" LEFTMARGIN="0" BOTTOMMARGIN="0"
RIGHTMARGIN="0" BGCOLOR="white" onload="setAnchorFocus();if (!isCrossDomainTop()) top.document.title='';setupTimeout();"><table cellpadding="0" cellspacing="0" border="0" hspace="0" vspace="0" >
<tr><td colspan="2" height="20" valign="middle" align="left"><div class="PTBREADCRUMBMARGIN"><span class="PTBREADCRUMBCUR">Home</span></div></td></tr>
<tr><td colspan="2"><img src="/servlets/cs/PSHPRD/cache/PT_PORTAL_CLEAR_DOT_ENG_1.gif" border="0" hspace="0" vspace="1" height="5" width="600" align="right" valign="top"></td></tr>
<tr><td valign="top" colspan="2">
<table cellpadding="0" cellspacing="0" border="0" hspace="0" vspace="0">
<tr><td style="background-image: url(/servlets/cs/PSHPRD/cache/PT_PORTAL_H_EDGE_ENG_1.gif); background-color: white;" width="15" valign="top" bgcolor="#FFFFFF" align="right"><img src="/servlets/cs/PSHPRD/cache/PT_PORTAL_WHITE_DOT_ENG_1.gif" width="15" height="6" hspace="0" vspace="0"></td>
<td align="left" valign="top" bgcolor="#FFFFFF">
<table cellpadding="0" cellspacing="0" border="0">
<tr><td colspan="3" height="8"><img src="/servlets/cs/PSHPRD/cache/PT_PORTAL_H_A_TOP0_ENG_1.gif" width="185" height="8" border="0" hspace="0" vspace="0"></td></tr>
<TR ALIGN="LEFT"><TD WIDTH="6" HEIGHT="10" VALIGN="top"><IMG SRC="/servlets/cs/PSHPRD/cache/PT_PORTAL_CLEAR_DOT_ENG_1.gif" WIDTH="1" HEIGHT="1" HSPACE="0" VSPACE="0" BORDER="0" ALT=""></TD>
<TD colspan="2" width="100%" VALIGN="top" class="PTMENULINK"><A HREF="/servlets/iclientservlet/PSHPRD/?ICType=Script&ICScriptProgramName=WEBLIB_MENU.ISCRIPT3.FieldFormula.IScript_DrillDown&navc=2425&target=main0&RL=&menugroup=Define%20QQQBusiness%20Rules&Level=1&target=main0" NAME="H1R" ACCESSKEY=1><IMG SRC="/servlets/cs/PSHPRD/cache/PT_PORTAL_IC_PLUS_ENG_1.gif" BORDER="0" hspace="0" VSPACE="2" HEIGHT="10" WIDTH="10" Alt="Expand" align="left"> Define Business Rules</a></TD></TR>
<TR ALIGN="LEFT"><TD WIDTH="10"><IMG SRC="/servlets/cs/PSHPRD/cache/PT_PORTAL_CLEAR_DOT_ENG_1.gif" WIDTH="10" HEIGHT="6" HSPACE="0" VSPACE="0"></TD>
<TD WIDTH="15"><IMG SRC="/servlets/cs/PSHPRD/cache/PT_PORTAL_CLEAR_DOT_ENG_1.gif" WIDTH="15" HEIGHT="6" HSPACE="0" VSPACE="0"></TD>
<TD WIDTH="100%"><IMG SRC="/servlets/cs/PSHPRD/cache/PT_PORTAL_CLEAR_DOT_ENG_1.gif" WIDTH="1" HEIGHT="6" HSPACE="0" VSPACE="0"></TD></TR><TR ALIGN="LEFT"><TD WIDTH="6" HEIGHT="10" VALIGN="top"><IMG SRC="/servlets/cs/PSHPRD/cache/PT_PORTAL_CLEAR_DOT_ENG_1.gif" WIDTH="1" HEIGHT="1" HSPACE="0" VSPACE="0" BORDER="0"></TD>
<TD><hr noshade size="1" class="levelDivider" width="150" align="left"/></TD><td></td></tr>
<TR ALIGN="LEFT"><TD WIDTH="10"><IMG SRC="/servlets/cs/PSHPRD/cache/PT_PORTAL_CLEAR_DOT_ENG_1.gif" WIDTH="10" HEIGHT="4" HSPACE="0" VSPACE="0"></TD>
<TD WIDTH="15"><IMG SRC="/servlets/cs/PSHPRD/cache/PT_PORTAL_CLEAR_DOT_ENG_1.gif" WIDTH="15" HEIGHT="4" HSPACE="0" VSPACE="0"></TD>
<TD><IMG SRC="/servlets/cs/PSHPRD/cache/PT_PORTAL_CLEAR_DOT_ENG_1.gif" WIDTH="1" HEIGHT="4" HSPACE="0" VSPACE="0"></TD></TR><TR ALIGN="LEFT"><TD WIDTH="6" HEIGHT="10" VALIGN="top"><IMG SRC="/servlets/cs/PSHPRD/cache/PT_PORTAL_CLEAR_DOT_ENG_1.gif" WIDTH="1" HEIGHT="1" HSPACE="0" VSPACE="0" BORDER="0" ALT=""></TD>
<TD colspan="2" width="100%" VALIGN="top" class="PTMENULINK"><A HREF="/servlets/iclientservlet/PSHPRD/?ICType=Script&ICScriptProgramName=WEBLIB_MENU.ISCRIPT3.FieldFormula.IScript_DrillDown&navc=2425&target=main0&menugroup=PeopleTools&Level=1&target=main0" NAME="H1R" ACCESSKEY=1><IMG SRC="/servlets/cs/PSHPRD/cache/PT_PORTAL_IC_PLUS_ENG_1.gif" BORDER="0" hspace="0" VSPACE="2" HEIGHT="10" WIDTH="10" Alt="Expand" align="left"> PeopleTools</a></TD></TR>
<TR ALIGN="LEFT"><TD WIDTH="10"><IMG SRC="/servlets/cs/PSHPRD/cache/PT_PORTAL_CLEAR_DOT_ENG_1.gif" WIDTH="10" HEIGHT="6" HSPACE="0" VSPACE="0"></TD>
<TD WIDTH="15"><IMG SRC="/servlets/cs/PSHPRD/cache/PT_PORTAL_CLEAR_DOT_ENG_1.gif" WIDTH="15" HEIGHT="6" HSPACE="0" VSPACE="0"></TD>
<TD WIDTH="100%"><IMG SRC="/servlets/cs/PSHPRD/cache/PT_PORTAL_CLEAR_DOT_ENG_1.gif" WIDTH="1" HEIGHT="6" HSPACE="0" VSPACE="0"></TD></TR></table></td>
<td width="6" align="left" valign="top" bgcolor="#FFFFFF"><img src="/servlets/cs/PSHPRD/cache/PT_PORTAL_CLEAR_DOT_ENG_1.gif" width="1" height="1" hspace="0" vspace="0"></td></tr>
<tr><td style="background-image: url(/servlets/cs/PSHPRD/cache/PT_PORTAL_H_EDGE_ENG_1.gif); background-color: white;" CLASS="edge"><img src="/servlets/cs/PSHPRD/cache/PT_PORTAL_CLEAR_DOT_ENG_1.gif" width="1" height="1" hspace="0" vspace="0"></td>
<td bgcolor="#FFFFFF"><img src="/servlets/cs/PSHPRD/cache/PT_PORTAL_H_GRAD_A_ENG_1.JPG" height="1" width="185" hspace="0" vspace="0"></td>
<td></td></tr></table></td></tr>
</table></BODY></HTML>

I'm not sure if you can get the source for a frame from within IE Builder.

All you need to do is open IE go to the page right click (inside the frame)-->view source. Then just post what that gives you here.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Good morning Eric,

Links will start out with "<a href", also we know that the link you wish to click has the text of "Define Business Rules". So we search the source for "Define Business Rules" and only get one match. However what you couldn't see on the webpage is that it contains a space before Define. So with what we know now we can build our script.

#include <IE.au3>

$oIE = _IECreate()
_IENavigate($oIE, "www.Your-Website.com")
$oFrame = _IEFrameGetObjByName($oIE, "Portal Header"); here we get a match to the frame that the link is in
_IEClickLinkByText($oFrame, " Define Business Rules"); here we click the link, note the space before Define

Edit: changed function name

Edited by big_daddy

Share this post


Link to post
Share on other sites

#11 ·  Posted

Good Afternoon big_daddy,

I think I am starting to grasp the concept. Look at the frame name from the parent window. Create a handle on that object and start calling elements within it. For links, we can grab by the "displayed text". For textbox, we grab by the "name" listed in the codes.

However, I think I am not implementing things right. I am getting this error when I launch the script below. It is the same error I got initially that lead me to post.

Line 441 (File "C:\...."):

If IsObj($o_object.document.parentwindow.frames($s_name, $i_index)) Then

If ^ ERROR

Error: The requested action with this object has failed.

This is what I got so far -- code wise:

#include <IE.au3>

$o_IE = _IECreate ()
_IENavigate ( $o_IE, "http://hrms:7001/servlets/iclientservlet/PSHPRD/?cmd=login&languageCd=ENG" )

WinWaitActive ( "PeopleSoft 8 Sign-in - Microsoft Internet Explorer" )
$oForm = _IEFormGetObjByName ( $o_IE, "login" )
$oUserId = _IEFormElementGetObjByName ( $oForm, "userid" )
$oPassword = _IEFormElementGetObjByName ( $oForm, "pwd" )
$oButton = _IEFormElementGetObjByName ( $oForm, "Submit" )

_IEFormElementSetValue($oUserId, "sometestid" )
_IEFormElementSetValue($oPassword, "sometestpasswd" )
$oButton.focus()
Send ( "{ENTER}" )

WinWaitActive ( "http://hrms:7001/servlets/iclientservlet/PSHPRD/?cmd=start&" )
$oFrame = _IEFrameGetObjByName ( $o_IE, "Portal Header" )
_IEClickLinkByText ( $oFrame, " Define Business Rules")

Good morning Eric,

Links will start out with "<a href", also we know that the link you wish to click has the text of "Define Business Rules". So we search the source for "Define Business Rules" and only get one match. However what you couldn't see on the webpage is that it contains a space before Define. So with what we know now we can build our script.

#include <IE.au3>

$oIE = _IECreate()
_IENavigate($oIE, "www.Your-Website.com")
$oFrame = _IEFrameGetObjByName($oIE, "Portal Header"); here we get a match to the frame that the link is in
_IEClickLinkByText($oFrame, " Define Business Rules"); here we click the link, note the space before Define

Edit: changed function name

Share this post


Link to post
Share on other sites

#12 ·  Posted

I mistook the frame title for the name, try this:

#include <IE.au3>

$oIE = _IECreate ()
_IENavigate ($oIE, "http://hrms:7001/servlets/iclientservlet/PSHPRD/?cmd=login&languageCd=ENG")

WinWaitActive("PeopleSoft 8 Sign-in - Microsoft Internet Explorer")
$oForm = _IEFormGetObjByName ($oIE, "login")
$oUserId = _IEFormElementGetObjByName ($oForm, "userid")
$oPassword = _IEFormElementGetObjByName ($oForm, "pwd")
;$oButton = _IEFormElementGetObjByName ( $oForm, "Submit" )

_IEFormElementSetValue ($oUserId, "sometestid")
_IEFormElementSetValue ($oPassword, "sometestpasswd")
_IEFormSubmit ($oForm)
;$oButton.focus()
;Send ( "{ENTER}" )

WinWaitActive("http://hrms:7001/servlets/iclientservlet/PSHPRD/?cmd=start&")
$oFrame = _IEFrameGetObjByName ($oIE, "header")
_IEClickLinkByText ($oFrame, " Define Business Rules")

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