Hi everybody,

I'm trying to use Watir, Ruby and AutoIt to create a script to login
to a website. When the login to this website is successful, a
"Security Information" message box is displayed, because the page
contains both secure and non-secure items. The "no" button on this
message box needs to be pressed, and I'm trying to use AutoIt to do
so.

Unfortunately, it does not always work. Sometimes the script is
successful in pressing "no," and other times it is not. Why is there
this inconsistency in behavior? (Could it be due to a timing issue? If
so, how could I make the script more robust? I don't want to simply
use a pause function...)

Any help will be greatly appreciated!

Here is the script:

require 'win32ole'
require 'watir'

ie = Watir::IE.new
ie.goto "http://www.example.com"; # This isn't really the site I'll run
it on.
ie.text_field(:name, "username").set("username")
ie.text_field(:name, "password").set("password")

@autoit = WIN32OLE.new('AutoItX3.Control')
ie.button(:name, "Login").click
@autoit.WinWait "Security Information", ""
@autoit.Send "!n"

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to