Module: Watir

Includes:
Exception
Included in:
Locator
Defined in:
lib/watir-classic/wait_helper.rb,
lib/watir-classic/form.rb,
lib/watir-classic/link.rb,
lib/watir-classic/util.rb,
lib/watir-classic/wait.rb,
lib/watir-classic/frame.rb,
lib/watir-classic/image.rb,
lib/watir-classic/table.rb,
lib/watir-classic/win32.rb,
lib/watir-classic/logger.rb,
lib/watir-classic/module.rb,
lib/watir-classic/waiter.rb,
lib/watir-classic/window.rb,
lib/watir-classic/browser.rb,
lib/watir-classic/cookies.rb,
lib/watir-classic/element.rb,
lib/watir-classic/locator.rb,
lib/watir-classic/options.rb,
lib/watir-classic/process.rb,
lib/watir-classic/version.rb,
lib/watir-classic/ie-class.rb,
lib/watir-classic/testcase.rb,
lib/watir-classic/close_all.rb,
lib/watir-classic/container.rb,
lib/watir-classic/assertions.rb,
lib/watir-classic/exceptions.rb,
lib/watir-classic/ie-process.rb,
lib/watir-classic/modal_dialog.rb,
lib/watir-classic/xpath_locator.rb,
lib/watir-classic/input_elements.rb,
lib/watir-classic/page-container.rb,
lib/watir-classic/screen_capture.rb,
lib/watir-classic/dialogs/file_field.rb,
lib/watir-classic/dialogs/javascript.rb,
lib/watir-classic/element_collection.rb,
lib/watir-classic/element_extensions.rb,
lib/watir-classic/supported_elements.rb,
lib/watir-classic/drag_and_drop_helper.rb,
lib/watir-classic/non_control_elements.rb,
lib/watir-classic/contrib/enabled_popup.rb,
lib/watir-classic/contrib/ie-new-process.rb

Overview

include this module if there’s a need to have wait_until and wait_while methods in some different scope

Defined Under Namespace

Modules: Assertions, Browser, Container, DragAndDropHelper, ElementExtensions, Exception, PageContainer, Process, RadioCheckCommon, ScreenCapture, TableCellsContainer, TableContainer, TableElementsContainer, TableRowsContainer, Wait, WaitHelper, Win32, XpathLocator Classes: Area, Audio, Base, Button, CheckBox, Command, Cookies, Data, DefaultLogger, Element, ElementCollection, Embed, FieldSet, FileField, Font, Form, FormLocator, Frame, FrameLocator, HTMLElementCollection, Hidden, IE, Image, InputElement, InputElementCollection, InputElementLocator, JavascriptDialog, Keygen, Label, Li, Link, Locator, Map, Menu, Meta, Meter, ModalDialog, Object, Optgroup, Option, Output, Param, Progress, Radio, Script, SelectList, Source, Style, Table, TableCell, TableCellCollection, TableElementCollection, TableRow, TableRowCollection, TableSection, TaggedElementLocator, TestCase, TextField, TimeKeeper, Track, Util, Video, Waiter, WatirLogger, WatirOptions, Window

Constant Summary collapse

VERSION =
File.exists?(version_file) ? File.read(version_file).strip : "0.0.0"
@@dir =

Directory containing the watir.rb file

File.expand_path(File.dirname(__FILE__))
@@options_file =
nil
@@options =
nil

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Exception

message_for_unable_to_locate

Class Method Details

.optionsObject

Return the Watir options, as a hash. If they haven’t been parsed yet, they will be now.



24
25
26
# File 'lib/watir-classic/options.rb', line 24

def options
  @@options ||= Watir::WatirOptions.new.execute
end

.options=(x) ⇒ Object



19
20
21
# File 'lib/watir-classic/options.rb', line 19

def options= x
  @@options = x
end

.options_fileObject



16
17
18
# File 'lib/watir-classic/options.rb', line 16

def options_file
  @@options_file
end

.options_file=(file) ⇒ Object

Specify the location of a yaml file containing Watir options. Must be specified before the options are parsed.



13
14
15
# File 'lib/watir-classic/options.rb', line 13

def options_file= file
  @@options_file = file
end

.until_with_timeoutObject

Like regular Ruby “until”, except that a Wait::TimeoutError is raised if the timeout is exceeded. Timeout is IE.attach_timeout.



9
10
11
# File 'lib/watir-classic/module.rb', line 9

def self.until_with_timeout # block
  Wait.until(IE.attach_timeout) { yield }
end

Instance Method Details

#wait_until(*args) ⇒ Object



10
11
12
# File 'lib/watir-classic/waiter.rb', line 10

def wait_until(*args)
  Waiter.wait_until(*args) {yield}
end