Class: WinClicker

Inherits:
Object
  • Object
show all
Defined in:
lib/firewatir/winClicker.rb

Overview

Linux/X11 implementation of WinClicker. Not all functionality is present because of the differences between X11 and Win32.

Instance Method Summary collapse

Instance Method Details

#clearSecurityAlertBoxObject



24
25
26
27
# File 'lib/firewatir/winClicker.rb', line 24

def clearSecurityAlertBox
  click_window_button(/Unknown Authority/, "OK")
  click_window_button(/Domain Name Mismatch/, "Cancel")
end

#clickJavaScriptDialog(button = "OK") ⇒ Object



9
10
11
# File 'lib/firewatir/winClicker.rb', line 9

def clickJavaScriptDialog(button="OK")
  click_window_button(/The page/,button)
end

#clickJSDialog_Thread(button = "OK") ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/firewatir/winClicker.rb', line 13

def clickJSDialog_Thread(button="OK")
  puts "clickJSDialog_Thread Starting waiting..."
  sleep 3
  puts " clickJSDialog_Thread ... resuming"
  n = 0
  while n < 3
    sleep 1
    click_window_button(/The page/,button)
  end
end

#clickWindowsButton(title, button, maxWaitTime = 30) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/firewatir/winClicker.rb', line 29

def clickWindowsButton(title, button, maxWaitTime=30)
  start = Time.now
  w = window_by_title(title)
  until w || (Time.now - start > maxWaitTime)
    sleep(2) # Window search is pretty CPU intensive, so relax the requirement

    w = window_by_title(title)
  end
  unless w
    puts "clickWindowsButton: Cant make window active in specified time ( " + maxWaitTime.to_s + ") - no handle"
    return false
  end
  click_button(w,button)
end