Module: Watir

Defined in:
lib/watir/legacy_wait.rb,
lib/watir.rb,
lib/watir/wait.rb,
lib/watir/alert.rb,
lib/watir/atoms.rb,
lib/watir/window.rb,
lib/watir/aliases.rb,
lib/watir/browser.rb,
lib/watir/cookies.rb,
lib/watir/adjacent.rb,
lib/watir/container.rb,
lib/watir/exception.rb,
lib/watir/has_window.rb,
lib/watir/screenshot.rb,
lib/watir/wait/timer.rb,
lib/watir/after_hooks.rb,
lib/watir/elements/row.rb,
lib/watir/elements/area.rb,
lib/watir/elements/cell.rb,
lib/watir/elements/font.rb,
lib/watir/elements/form.rb,
lib/watir/elements/link.rb,
lib/watir/row_container.rb,
lib/watir/user_editable.rb,
lib/watir/xpath_support.rb,
lib/watir/cell_container.rb,
lib/watir/elements/dlist.rb,
lib/watir/elements/image.rb,
lib/watir/elements/input.rb,
lib/watir/elements/radio.rb,
lib/watir/elements/table.rb,
lib/watir/elements/button.rb,
lib/watir/elements/hidden.rb,
lib/watir/elements/iframe.rb,
lib/watir/elements/option.rb,
lib/watir/elements/select.rb,
lib/watir/attribute_helper.rb,
lib/watir/elements/element.rb,
lib/watir/elements/checkbox.rb,
lib/watir/element_collection.rb,
lib/watir/elements/table_row.rb,
lib/watir/elements/text_area.rb,
lib/watir/elements/file_field.rb,
lib/watir/elements/table_cell.rb,
lib/watir/elements/text_field.rb,
lib/watir/extensions/nokogiri.rb,
lib/watir/generator/base/util.rb,
lib/watir/locators/row/locator.rb,
lib/watir/elements/svg_elements.rb,
lib/watir/generator/svg/visitor.rb,
lib/watir/locators/cell/locator.rb,
lib/watir/elements/html_elements.rb,
lib/watir/elements/table_section.rb,
lib/watir/extensions/select_text.rb,
lib/watir/generator/base/visitor.rb,
lib/watir/generator/html/visitor.rb,
lib/watir/generator/svg/generator.rb,
lib/watir/locators/button/locator.rb,
lib/watir/generator/base/generator.rb,
lib/watir/generator/html/generator.rb,
lib/watir/locators/element/locator.rb,
lib/watir/generator/base/idl_sorter.rb,
lib/watir/locators/button/validator.rb,
lib/watir/locators/element/validator.rb,
lib/watir/locators/text_area/locator.rb,
lib/watir/locators/text_field/locator.rb,
lib/watir/generator/svg/spec_extractor.rb,
lib/watir/generator/base/spec_extractor.rb,
lib/watir/generator/html/spec_extractor.rb,
lib/watir/locators/row/selector_builder.rb,
lib/watir/locators/text_field/validator.rb,
lib/watir/locators/cell/selector_builder.rb,
lib/watir/locators/button/selector_builder.rb,
lib/watir/locators/element/selector_builder.rb,
lib/watir/locators/text_area/selector_builder.rb,
lib/watir/locators/text_field/selector_builder.rb,
lib/watir/locators/button/selector_builder/xpath.rb,
lib/watir/locators/element/selector_builder/xpath.rb,
lib/watir/locators/text_field/selector_builder/xpath.rb

Overview

Autogenerated from HTML specification. Edits may be lost.

Defined Under Namespace

Modules: Adjacent, Atoms, AttributeHelper, CellContainer, Container, EventuallyPresent, Exception, Generator, HasWindow, Locators, RowContainer, UserEditable, Wait, Waitable, XpathSupport Classes: AfterHooks, Alert, Anchor, AnchorCollection, Animate, AnimateCollection, AnimateMotion, AnimateMotionCollection, AnimateTransform, AnimateTransformCollection, Animation, AnimationCollection, Applet, AppletCollection, Area, AreaCollection, Audio, AudioCollection, BR, BRCollection, Base, BaseCollection, BaseDecorator, Body, BodyCollection, Browser, Button, ButtonCollection, Canvas, CanvasCollection, Cell, CellCollection, CheckBox, CheckBoxCollection, Circle, CircleCollection, Cookies, Cursor, CursorCollection, DList, DListCollection, Data, DataCollection, DataList, DataListCollection, Defs, DefsCollection, Desc, DescCollection, Details, DetailsCollection, Dialog, DialogCollection, Directory, DirectoryCollection, Div, DivCollection, Element, ElementCollection, Ellipse, EllipseCollection, Embed, EmbedCollection, FieldSet, FieldSetCollection, FileField, FileFieldCollection, Font, FontCollection, ForeignObject, ForeignObjectCollection, Form, FormCollection, Frame, FrameCollection, FrameSet, FrameSetCollection, FramedDriver, G, GCollection, Geometry, GeometryCollection, Gradient, GradientCollection, Graphics, GraphicsCollection, HR, HRCollection, HTMLElement, HTMLElementCollection, Head, HeadCollection, Heading, HeadingCollection, Hidden, HiddenCollection, Html, HtmlCollection, IFrame, IFrameCollection, Image, ImageCollection, Input, InputCollection, Keygen, KeygenCollection, LI, LICollection, Label, LabelCollection, Legend, LegendCollection, Line, LineCollection, LinearGradient, LinearGradientCollection, MPath, MPathCollection, Map, MapCollection, Marker, MarkerCollection, Marquee, MarqueeCollection, Media, MediaCollection, Menu, MenuCollection, MenuItem, MenuItemCollection, MeshGradient, MeshGradientCollection, MeshPatch, MeshPatchCollection, MeshRow, MeshRowCollection, Meta, MetaCollection, Metadata, MetadataCollection, Meter, MeterCollection, Mod, ModCollection, OList, OListCollection, Object, ObjectCollection, OptGroup, OptGroupCollection, Option, OptionCollection, Output, OutputCollection, Paragraph, ParagraphCollection, Param, ParamCollection, Path, PathCollection, Pattern, PatternCollection, Picture, PictureCollection, Polygon, PolygonCollection, Polyline, PolylineCollection, Pre, PreCollection, Progress, ProgressCollection, Quote, QuoteCollection, RadialGradient, RadialGradientCollection, Radio, RadioCollection, Rect, RectCollection, Row, RowCollection, SVG, SVGCollection, SVGElement, SVGElementCollection, Screenshot, Script, ScriptCollection, Select, SelectCollection, Set, SetCollection, Source, SourceCollection, Span, SpanCollection, Stop, StopCollection, Style, StyleCollection, Switch, SwitchCollection, Symbol, SymbolCollection, TSpan, TSpanCollection, Table, TableCaption, TableCaptionCollection, TableCell, TableCellCollection, TableCol, TableColCollection, TableCollection, TableDataCell, TableDataCellCollection, TableHeaderCell, TableHeaderCellCollection, TableRow, TableRowCollection, TableSection, TableSectionCollection, Template, TemplateCollection, TextArea, TextAreaCollection, TextContent, TextContentCollection, TextField, TextFieldCollection, TextPath, TextPathCollection, TextPositioning, TextPositioningCollection, Time, TimeCollection, Title, TitleCollection, Track, TrackCollection, UList, UListCollection, Unknown, UnknownCollection, Use, UseCollection, Video, VideoCollection, View, ViewCollection, WhenEnabledDecorator, WhenPresentDecorator, Window

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.always_locate=(value) ⇒ Object (writeonly)

Sets the attribute always_locate



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

def always_locate=(value)
  @always_locate = value
end

.default_timeoutObject

Default wait time for wait methods.



74
75
76
# File 'lib/watir.rb', line 74

def default_timeout
  @default_timeout ||= 30
end

.locator_namespaceObject

Whether the locators should be used from a different namespace. Defaults to Watir::Locators.



83
84
85
# File 'lib/watir.rb', line 83

def locator_namespace
  @locator_namespace ||= Watir::Locators
end

.prefer_css=(value) ⇒ Object (writeonly)

Sets the attribute prefer_css



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

def prefer_css=(value)
  @prefer_css = value
end

.relaxed_locate=(value) ⇒ Object (writeonly)

Sets the attribute relaxed_locate



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

def relaxed_locate=(value)
  @relaxed_locate = value
end

Class Method Details

.always_locate?Boolean

Whether or not Watir should re-locate a stale Element on use.



40
41
42
43
# File 'lib/watir.rb', line 40

def always_locate?
  always_locate_message
  true
end

.always_locate_messageObject



45
46
47
48
49
50
51
# File 'lib/watir.rb', line 45

def always_locate_message
  warn "Watir#always_locate is deprecated; elements are always cached and will always\nbe re-located if they go stale before use.\nUse Element#stale? or Element#wait_until(&:stale?) if needed for flow control.\n"
end

.element_class_for(tag_name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



99
100
101
# File 'lib/watir.rb', line 99

def element_class_for(tag_name)
  tag_to_class[tag_name.to_sym] || HTMLElement
end

.prefer_css?Boolean

Whether or not Watir should prefer CSS when translating the Watir selectors to Selenium.



57
58
59
60
# File 'lib/watir.rb', line 57

def prefer_css?
  prefer_css_message
  false
end

.prefer_css_messageObject



62
63
64
65
66
67
68
# File 'lib/watir.rb', line 62

def prefer_css_message
  warn "Watir#prefer_css is deprecated; all elements that can not be passed directly\nas Selenium locators will be translated to XPath. To continue using CSS Selectors\nrequire the watir_css gem - https://github.com/watir/watir_css\n"
end

.relaxed_locate?Boolean

Whether or not Watir should wait for an element to be found or present before taking an action. Defaults to true.



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

def relaxed_locate?
  @relaxed_locate
end

.tag_to_classObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



91
92
93
# File 'lib/watir.rb', line 91

def tag_to_class
  @tag_to_class ||= {}
end