Class: Watir::Locators::TextField::SelectorBuilder::XPath
Constant Summary
Element::SelectorBuilder::XPath::CAN_NOT_BUILD, Element::SelectorBuilder::XPath::LOCATOR
Element::SelectorBuilder::XpathSupport::LOWERCASE_LETTERS, Element::SelectorBuilder::XpathSupport::UPPERCASE_LETTERS
Instance Method Summary
collapse
#build
downcase, escape
Instance Method Details
#additional_string ⇒ Object
15
16
17
18
19
|
# File 'lib/watir/locators/text_field/selector_builder/xpath.rb', line 15
def additional_string
return '' if @adjacent
type_string(@selector.delete(:type))
end
|
#tag_string ⇒ Object
21
22
23
24
|
# File 'lib/watir/locators/text_field/selector_builder/xpath.rb', line 21
def tag_string
@selector[:tag_name] = 'input' unless @adjacent
super
end
|
#text_string ⇒ Object
8
9
10
11
12
13
|
# File 'lib/watir/locators/text_field/selector_builder/xpath.rb', line 8
def text_string
return super if @adjacent
@built[:text] = @selector.delete(:text) if @selector.key?(:text)
''
end
|
#type_string(type) ⇒ Object
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/watir/locators/text_field/selector_builder/xpath.rb', line 26
def type_string(type)
if type.eql?(true)
"[#{negative_type_text}]"
elsif Watir::TextField::NON_TEXT_TYPES.include?(type)
msg = "TextField Elements can not be located by type: #{type}"
raise LocatorException, msg
elsif type.nil?
"[not(@type) or (#{negative_type_text})]"
else
"[#{process_attribute(:type, type)}]"
end
end
|