Jump to content

Accessing IE Objects in Tables in Framesets


Recommended Posts

I am trying to simply fill in a password box, its name is (EnterPasswordBox). I have tried various ways of getting to it but I cannot seem to find the correct sytax. Below is the IE Dev tool bar outline of the object and the source is below. Can someone help me out with this?

+<HEAD>

|

- <FRAMESET>

|

+<FRAME ID=FrameHeader>

|

-<FRAME ID=FramePager>

|

-#document

|

#comment

-<HTML>

+<HEAD>

|

-<BODY id=Body1>

-<FORM id=Form1>

|

<INPUT>

|

#text

-<TABLE id=Table1>

-<TBODY>

+<TR>

+<TR>

-<TR>

+<TD class=subtitle>

-<TD>

|<INPUT id=EnterPasswordBox>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML Transitional//EN"><META http-equiv="Content-Type" content="text/html; charset=utf-8"> <HTML><HEAD><STYLE> /* No matching styles were found. */ </STYLE></HEAD><BODY id="Body1" bottomMargin="10" topMargin="10" MS_POSITIONING="FlowLayout" NAME="Body1" MARGINHEIGHT="10" MARGINWIDTH="10"><FORM id="Form1" name="Form1" onsubmit="return(SubmitCheck());" action="Timeout.aspx?mdsc=0%3a6740&NB=Y" method="post"><TABLE id="Table1" cellSpacing="0" cellPadding="3" align="center" border="0"><TBODY><TR><TD vAlign="middle" align="left"> <INPUT id="EnterPasswordBox" style="WIDTH: 118px" type="password" name="EnterPasswordBox" value="" /> </TD></TR></TBODY></TABLE></FORM></BODY></HTML>

Link to comment
Share on other sites

  • Moderators

This should be close.

#include <IE.au3>

_IEErrorHandlerRegister()

$sURL = "www.SomeWhere.com"
$sPassword = "123456"

$oIE = _IECreate($sURL)
$oFrame = _IEFrameGetCollection($oIE, 1)
$oForm = _IEFormGetObjByName($oFrame, "Form1")
$oInput = _IEFormElementGetObjByName($oForm, "EnterPasswordBox")
_IEFormElementSetValue($oInput, $sPassword)
Link to comment
Share on other sites

Nope that is what I have tried and this is teh error I get

>Running:(3.2.2.0):shocked::\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\Rachel\Desktop\New Folder\22.au3"

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

--> IE.au3 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType

--> IE.au3 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType

+>16:03:10 AutoIT3.exe ended.rc:0

+>16:03:11 AutoIt3Wrapper Finished

Link to comment
Share on other sites

That FrameSet definition looks strange -- are you certain that is the extent of it?

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

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