Class: Watir::Browser
- Inherits:
-
Object
- Object
- Watir::Browser
- Defined in:
- lib/watir-classic/browser.rb
Overview
Watir is a family of open-source drivers for automating web browsers. You can use it to write tests that are easy to read and maintain.
Watir drives browsers the same way people do. It clicks links, fills in forms, presses buttons. Watir also checks results, such as whether expected text appears on a page.
The Watir Classic is a driver for Internet Explorer (on Windows).
Project Homepage: watir.com
Class Method Summary collapse
-
.attach(how, what) ⇒ Object
Attach to an existing IE Browser.
- .klass ⇒ Object
-
.new(ignored = nil) ⇒ Object
Create a new instance of the Browser object.
-
.options ⇒ Hash
Options of the Browser.
-
.set_options(options) ⇒ Object
Set options for the Browser.
-
.start(url) ⇒ Object
Create a new Browser instance as with Browser.new and start the browser on the specified url.
Class Method Details
.attach(how, what) ⇒ Object
Attach to an existing IE Watir::Browser.
77 78 79 80 |
# File 'lib/watir-classic/browser.rb', line 77 def attach(how, what) klass.attach(how, what) end |
.klass ⇒ Object
94 95 96 97 |
# File 'lib/watir-classic/browser.rb', line 94 def klass key = Watir.[:browser] eval @@browser_classes[key] # this triggers the autoload end |
.new(ignored = nil) ⇒ Object
Create a new instance of the Watir::Browser object
47 48 49 50 |
# File 'lib/watir-classic/browser.rb', line 47 def new(ignored=nil) klass.new end |
.options ⇒ Hash
Returns options of the Watir::Browser.
89 90 91 92 |
# File 'lib/watir-classic/browser.rb', line 89 def return {} unless klass.respond_to?(:options) klass. end |
.set_options(options) ⇒ Object
Set options for the Watir::Browser.
83 84 85 86 |
# File 'lib/watir-classic/browser.rb', line 83 def () return unless klass.respond_to?(:set_options) klass. end |
.start(url) ⇒ Object
Create a new Watir::Browser instance as with new and start the browser on the specified url.
55 56 57 58 |
# File 'lib/watir-classic/browser.rb', line 55 def start(url) klass.start url end |