#open the IE browser
ie = Watir::IE.new
# go to login site
ie.goto test_site
ie.show_frames
ie.frame(:id, "leftFrame").link(:id,"divDB").click
ie.frame(:id, "mainFrame").text_field(:id, "PoolName2").set(poolname)# "USER" is name of username
ie.frame(:id, "mainFrame").text_field(:name, "SearchHostName").set(hostname)# "PASSWORD" is name of password field
ie.frame(:id, "mainFrame").button(:index, 2).click
sleep (2)
autoit = WIN32OLE.new("AutoItX3.Control")
i=6
while i>0 do
$autoit.Send('{TAB}')
sleep 1
i=i-1
end
$autoit.Send('{ENTER}')
if ie.frame(:id, "infoFrame").contains_text("Hostname")
autoit.Run('C:\Sophia\Project\Learning\Selenium\Autoit Code\Login.exe')
else
autoit.Run('C:\Sophia\Project\Learning\Selenium\Autoit Code\Error.exe')
end