Sign in to follow this  
Followers 0
mdes

Internet Explorer - Form

5 posts in this topic

I would like to click on a button field of a html form. I tried to use

ControlClick ("Bla bla bla -", "", "Send Report(s) Now")
but AutoIT does not find the button. I tried also differents funtions like ControlFocus(), ControlSetText(), but without success.

How can I do that ?

Here is a part of the html form:

<form action="/sc" method="post"
  enctype="multipart/form-data" name="sendreport">

... (a lot of hidden fields, text,...)

Additional notes (optional - max 2000 characters):<br>
<textarea name="notes" rows=3 cols=60 wrap="physical" >
</textarea><br>

<input type="submit" value="Send Report(s) Now">
<input type="submit" name="cancel" value="Cancel">

Gestion des congés, RTT, vacances scolaires, autres absences sur Pocket PC : CongésRFV

Share this post


Link to post
Share on other sites



HTML is not a real form, and the buttons are not really buttons, but just graphics and text.

One way to do forms on HTML pages is to first make sure of the title, and that it is loaded, and then do a find on the page for known text on that page, and then Tab to the button and send space.

I use this technique a lot. I also rename the page, so that I know when it loads the next page.


AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

oh yea, here is a test code I did for the partial HTML you sent:

$pagename="C:\Documen"; name this to your document
WinWaitActive($pagename) 
send("^f")
WinWaitActive("Find")
send("optional{enter}")
sleep(1000)
send("{esc}")
WinWaitActive("$pagename")
send("{tab 2}")
send("{space}")

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

That's fine ! Thank a lot :D

ps: Why do you put

WinWaitActive("$pagename")
instead of
WinWaitActive($pagename)
?

Gestion des congés, RTT, vacances scolaires, autres absences sur Pocket PC : CongésRFV

Share this post


Link to post
Share on other sites

because I made a mistake :D

Glad you saw it.


AutoIt3, the MACGYVER Pocket Knife for computers.

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