Class: Watir::Browser
- Inherits:
-
Object
- Object
- Watir::Browser
- Defined in:
- lib/spec/ui/watir/browser.rb,
lib/spec/ui/watir/browser.rb
Instance Method Summary collapse
- #_old_goto ⇒ Object
-
#goto(url) ⇒ Object
Redefinition of Watir’s original goto, which gives a better exception message (the URL is in the message).
-
#initialize ⇒ Browser
constructor
Brings the IE to the foreground (provided Win32::Screenshot is installed).
- #kill! ⇒ Object
- #old_initialize ⇒ Object
Constructor Details
#initialize ⇒ Browser
Brings the IE to the foreground (provided Win32::Screenshot is installed)
13 14 15 16 17 |
# File 'lib/spec/ui/watir/browser.rb', line 13 def initialize result = old_initialize ::Win32::Screenshot.setForegroundWindow(self.getIE.hwnd) rescue nil result end |
Instance Method Details
#_old_goto ⇒ Object
26 |
# File 'lib/spec/ui/watir/browser.rb', line 26 alias _old_goto goto |
#goto(url) ⇒ Object
Redefinition of Watir’s original goto, which gives a better exception message (the URL is in the message)
29 30 31 32 33 34 35 36 |
# File 'lib/spec/ui/watir/browser.rb', line 29 def goto(url) begin _old_goto(url) rescue => e e. << "\nURL: #{url}" raise e end end |
#kill! ⇒ Object
22 23 24 |
# File 'lib/spec/ui/watir/browser.rb', line 22 def kill! close end |
#old_initialize ⇒ Object
11 |
# File 'lib/spec/ui/watir/browser.rb', line 11 alias old_initialize initialize |