Sign in to follow this  
Followers 0
Terenz

IE Basic Task

7 posts in this topic

Hello. I need to "automize" an intranet website, some task nothing too difficult but seems i can't. I need to:

1) Write on an inputbox

2) Click on a button

3) Get text from an editbox

I'm stuck with the first :(

The main problem is i can't get any form ( using example from the help at _IEFormGetCollection in For...Loop ) but at least i know the name of the input:

<input name="TxTInput" type="text" id="TxTInput" style="font-size:Smaller;width:60px;">

What i need to do?


Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

_IEGetObjById
_IEPropertySet ;"innertext" value for property paramenter should work

These should work for you

P.S: why can't you get any form?

Edited by j0kky

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Nope

#include <IE.au3>

$oIE = _IECreate("mysite")
Local $oDiv = _IEGetObjById($oIE, "TxTInput")
ConsoleWrite($oDiv & @CRLF)
_IEPropertySet($oDiv, "innertext", "Look What I can Do")

_IEGetObjById return zero. Seems the input is inside a table:

table id="TableMain" cellspacing="0" cellpadding="6" border="0" style="border-color:#FFCC00;border-width:1px;border-style:solid;width:430px;border-collapse:collapse;">

Does matter?

P.S: why can't you get any form?

I don't have any idea, the function _IEFormGetCollection rertun the message There are 0 form(s) on this page

Edited by Terenz

Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Share this post


Link to post
Share on other sites

Is your control in a Frame or iFrame?

Do a forum search if it is.  This was answered pleanty of times.


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.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

How i can know if is a Frame or iFrame?  :sweating:

With this script i can get all element of the Frame ( There is only 1 Frame ):

Local $oFrames = _IEFrameGetCollection($oIE)
Local $iNumFrames = @extended
Local $sTxt = $iNumFrames & " frames found" & @CRLF & @CRLF
Local $oFrame = 0
For $i = 0 To ($iNumFrames - 1)
    $oFrame = _IEFrameGetCollection($oIE, $i)
    $sTxt &= _IEPropertyGet($oFrame, "innertext") & @CRLF
Next
MsgBox(0, "Frames Info", $sTxt)

_IEQuit($oIE)

Like the label, drop menu etc. but how to get the inputbox and set a text?

Edited by Terenz

Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Share this post


Link to post
Share on other sites

Look through the HTML source, and check if one of your nodes ancestors is a <Frame> or <iFrame>.

If it is, in the loop you just posted, use:

$oYourobject = _IEGetObjById($oFrame,"yourNameYouWantToGet")
1 person likes this

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.

Share this post


Link to post
Share on other sites

Ok, thank you guys i'm working on it and if i have a problem i'll let you know


Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

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