Top Level Namespace

Includes:
ObjectSpace, RIESS, Win32::AutoGui

Defined Under Namespace

Modules: Actions, Checks, Kernel, RIESS Classes: HTMLGeneric, IEParser, IEParserTopDown, Missing, Tokenize, WIN32OLE

Constant Summary

Constants included from RIESS

RIESS::Log

Instance Method Summary collapse

Instance Method Details

#dialog_handler(timeout, title, text) ⇒ Object

Pop = Log4r::Logger.new(“POP”) Pop.add Log4r::Outputter.stderr Pop.level = Log4r::INFO



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/popup.rb', line 10

def dialog_handler(timeout,title,text)
  counter = 0
  loop do
    counter += 1
    sleep 1
    ie_windows = find_window_by_title title,0
    if not ie_windows 
#      Pop.info  "no window matching : #{title}"
      break if counter == timeout
    else 
#      Pop.info "Found #{ie_windows.size} potential windows" if ie_windows.kind_of? Array
      return ie_windows
      #break
    end  
  end
end

#javascript_alert(timeout, title, text, button) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/popup.rb', line 27

def javascript_alert(timeout,title,text,button)
  counter = 0
  loop do
    counter += 1
    sleep 1
    ie_windows = find_window_by_title title,0
    if not ie_windows 
#      Pop.info "no window matching : #{title}"
      exit if counter >= timeout
    else 
#        Pop.info "Found #{ie_windows.size} potential windows" if ie_windows.kind_of? Array
        if not ie_windows.kind_of? Array then ie_windows = [ie_windows] end
        ie_windows.each_with_index{|win,i|
           pop_up_text = win.find_children_by_text text,0 
           if pop_up_text
             btn = win.find_children_by_text button,0
             if not btn
#               Pop.info "no button matching : #{button}"
             else
               btn.focus_window
               btn.click_button
               exit
             end
           else 
#             Pop.info "Potential window #{i+1} has no text matching: #{text}"
             exit if counter >= timeout
           end
        }
    end
  end      
end