[Wtr-general] AutoIt -- Unable to actually click IE7 buttons

2007-05-23 Thread Erik Oliver
So, I'm running into a weird problem with AutoIt and IE7 file download
buttons I want to click "Save", but am having no love.

I've tried a number of different approaches (see below) with no luck.
The uncommented version is what has come closest to working in that it
actually manages to switch the focus to the 'Save' item. (send("!s")
manages to underline the 'S', etc., but not 'hit' the save.)

Any thoughts as to what is happening? It is as if there is some black
hole of an event sink swallowing my clicks/sent keys?

Regards,
Erik

autoit.WinActivate ("File Download")
autoit.WinWaitActive ("File Download")
autoit.ControlFocus("File Download","", 4427)
autoit.ControlClick("File Download", "", 4427)

#autoit.Send("!s")

#autoit.ControlFocus("File Download","","&Save")
#autoit.ControlClick("File Download", "Do you want to open or save
this file?", "&Save")

#autoit.ControlFocus("File Download", "",
"[CLASS:Button;TEXT:&Send;INSTANCE:2]")
#autoit.ControlClick("File Download", "",
"[CLASS:Button;TEXT:&Send;INSTANCE:2]")
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] IE7 security issues and changing action value of

2007-05-21 Thread Erik Oliver
Chris McMahon wrote at Mon May 21 14:27:44 EDT 2007:
> Might be worth trying Mechanize to bypass the nasty UI:
> http://rubyforge.org/projects/mechanize/

The UI is so nasty there is a Java Applet security app (Entrust
something or other and you need to provide a digital certificate) in
front of the nasty Javascript I am wrestling with. I decided that
having to manually enter the certificate was tolerable.

>From what I read I don't see how the mechanize project could help me
with the Java applet...

Meanwhile, I figured out how to get rid of the pop up, I put the site
in the trusted security zone and then set "Enable" for "Automatic
Prompting for file Downloads"...

...so next challenge scripting the save file dialog box.

Regards,
Erik

PS: The whole thing is very short right now ~30 lines and is probably
3 lines of code now away from doing what I want if I can get the save
to work.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] IE7 security issues and changing action value of a form

2007-05-21 Thread Erik Oliver
A web page I'm trying to automate with Watir works as follows: Visible
to user is a link to a javascript (JS1), JS1 in turn sets a bunch of
hidden form values AND the action URL of the form, JS1 then calls
submit on the form.

Purpose of using Watir is to automate a repetitive task (download of
multiple XML files from the website).

**STRATEGY 1***

Use the straightforward ie.link(:text, [text of link]) to cause JS1 to
invoke. That causes IE7 to pop up one of those nasty download warnings
and the script gets hung up.

Any suggestions for bypassing this?

**STRATEGY 2**

I tried to simulate the JS itself since what I'm trying to do is
automate a repetitive form task and batch download files, I generated
the following basic code:

form = ie.form(:name, 'appsByCustomer')
form.hidden(:name,'isSubmitted').value = 'isSubmitted'
form.hidden(:name,'paramForXmlDownload').value = 'forMultipleDownloads'
form.hidden(:name,'dosnum').value = 'null'
### problem is how do I set form.action, the obvious form.action =
'url string' doesn't work?
form.submit

Suggestions for how to set the action attribute?

Regards,
Erik

PS: The page basically has about 5 different Javascripts wrapping the
same form, the html has ,
each of the javascripts sets the action to a different value.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general