From ba55144f244896ef29ab3f32aeb9474aeb9fe553 Mon Sep 17 00:00:00 2001 From: PriestJ Date: Thu, 17 Jan 2008 13:26:09 +0000 Subject: [PATCH] added code to click the ok button when you try to delete the previous installs git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3285 248e525c-4dfb-0310-94bc-949c084e9493 --- Data/Test/apex_auto_install.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Data/Test/apex_auto_install.rb b/Data/Test/apex_auto_install.rb index 76c9e54..b4023c9 100644 --- a/Data/Test/apex_auto_install.rb +++ b/Data/Test/apex_auto_install.rb @@ -3,6 +3,29 @@ require 'watir' #email stuff require 'net/smtp' +#used to handle javascript popups +require 'watir/contrib/enabled_popup' +require 'watir/WindowHelper' +# +# Method to handle javascript popups. +# +require 'thread' +# +require 'win32ole' +# +def startClicker( button , waitTime = 3) + w = WinClicker.new + longName = @@ie.dir.gsub("/" , "\\" ) + shortName = w.getShortFileName(longName) + c = "start ruby #{shortName}\\watir\\clickJSDialog.rb #{button} #{waitTime} " + puts "Starting #{c}" + w.winsystem(c) + w=nil +end + + + + #includes include Watir @@ie = IE.new @@ -88,6 +111,8 @@ begin @@ie.link(:title, 'Manage Export Repository').click @@ie.wait @@ie.checkboxes.each { |c| c.set } + #Click the annoying are you sure button that pops up + startClicker("OK", 1) @@ie.button(:value, 'Delete Checked').click @@ie.wait end