Module: Watir

Includes:
Exception
Included in:
Locator
Defined in:
lib/watir/dialog.rb,
lib/watir/form.rb,
lib/watir/form.rb,
lib/watir/link.rb,
lib/watir/frame.rb,
lib/watir/image.rb,
lib/watir/popup.rb,
lib/watir/table.rb,
lib/watir/win32.rb,
lib/watir/logger.rb,
lib/watir/module.rb,
lib/watir/element.rb,
lib/watir/locator.rb,
lib/watir/process.rb,
lib/watir/ie-class.rb,
lib/watir/close_all.rb,
lib/watir/container.rb,
lib/watir/camel_case.rb,
lib/watir/ie-process.rb,
lib/watir/collections.rb,
lib/watir/html_element.rb,
lib/watir/modal_dialog.rb,
lib/watir/cookiemanager.rb,
lib/watir/input_elements.rb,
lib/watir/page-container.rb,
lib/watir/screen_capture.rb,
lib/watir/element_collections.rb,
lib/watir/non_control_elements.rb,
lib/watir/contrib/enabled_popup.rb,
lib/watir/contrib/ie-new-process.rb

Overview

This is a generic HTML Element that is used to locate all elements that share an attribute. The most common example would be finding elements that all share the same class.

Defined Under Namespace

Modules: CommonCollection, Container, CookieManager, FormAccess, OptionAccess, PageContainer, Process, ScreenCapture, Win32 Classes: Area, Areas, AttributeLengthPairs, Button, Buttons, CheckBox, CheckBoxes, Dd, Dds, DefaultLogger, Dialog, DialogButton, Div, Divs, Dl, Dls, Dt, Dts, Element, ElementCollections, ElementLocator, ElementMapper, Em, Ems, FileField, FileFields, Form, FormWrapper, Forms, Frame, H1, H2, H3, H4, H5, H6, HTMLElement, HTMLElements, Hidden, Hiddens, IE, Image, Images, InputElement, InputElementLocator, JSButton, Label, Labels, Li, Link, Links, Lis, Locator, Map, Maps, ModalDialog, NonControlElement, Option, OptionWrapper, P, PopUp, Pre, Pres, Ps, Radio, RadioCheckCommon, Radios, SelectList, SelectLists, Span, Spans, Strong, Strongs, Table, TableBodies, TableBody, TableCell, TableCells, TableRow, TableRows, Tables, TaggedElementLocator, TextField, TextFields, Ul, WatirLogger

Constant Summary collapse

@@dir =

Directory containing the watir.rb file

File.expand_path(File.dirname(__FILE__))
@@autoit =
nil

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

._register(dll) ⇒ Object



27
28
29
# File 'lib/watir/module.rb', line 27

def self._register(dll)
  system("regsvr32.exe /s "    + "#{@@dir}/#{dll}".gsub('/', '\\'))
end

._unregister(dll) ⇒ Object



31
32
33
# File 'lib/watir/module.rb', line 31

def self._unregister(dll)
  system("regsvr32.exe /s /u " + "#{@@dir}/#{dll}".gsub('/', '\\'))
end

.autoitObject



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/watir/module.rb', line 15

def self.autoit
  unless @@autoit
    begin
      @@autoit = WIN32OLE.new('AutoItX3.Control')
    rescue WIN32OLERuntimeError
      _register('AutoItX3.dll')
      @@autoit = WIN32OLE.new('AutoItX3.Control')
    end
  end
  @@autoit
end

.until_with_timeoutObject

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



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

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

Instance Method Details

#dialogObject



24
25
26
# File 'lib/watir/dialog.rb', line 24

def dialog
  Dialog.new
end