Class: Webdrone::Text

Inherits:
Object
  • Object
show all
Defined in:
lib/webdrone/text.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(a0) ⇒ Text

Returns a new instance of Text.



11
12
13
# File 'lib/webdrone/text.rb', line 11

def initialize(a0)
  @a0 = a0
end

Instance Attribute Details

#a0 ⇒ Object

Returns the value of attribute a0.



9
10
11
# File 'lib/webdrone/text.rb', line 9

def a0
  @a0
end

Instance Method Details

#button(text, n: 1, all: false, visible: true) ⇒ Object



33
34
35
36
37
# File 'lib/webdrone/text.rb', line 33

def button(text, n: 1, all: false, visible: true)
  @a0.find.button(text, n: n, all: all, visible: visible).text
rescue => exception
  Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end

#css(text) ⇒ Object



21
22
23
24
25
# File 'lib/webdrone/text.rb', line 21

def css(text)
  @a0.find.css(text).text
rescue => exception
  Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end

#id(text) ⇒ Object



15
16
17
18
19
# File 'lib/webdrone/text.rb', line 15

def id(text)
  @a0.find.id(text).text
rescue => exception
  Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end


27
28
29
30
31
# File 'lib/webdrone/text.rb', line 27

def link(text, n: 1, all: false, visible: true)
  @a0.find.link(text, n: n, all: all, visible: visible).text
rescue => exception
  Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end

#on(text, n: 1, all: false, visible: true) ⇒ Object



39
40
41
42
43
# File 'lib/webdrone/text.rb', line 39

def on(text, n: 1, all: false, visible: true)
  @a0.find.on(text, n: n, all: all, visible: visible).text
rescue => exception
  Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end

#option(text, n: 1, all: false, visible: true) ⇒ Object



45
46
47
48
49
# File 'lib/webdrone/text.rb', line 45

def option(text, n: 1, all: false, visible: true)
  @a0.find.option(text, n: n, all: all, visible: visible).text
rescue => exception
  Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end

#page_title ⇒ Object



57
58
59
60
61
# File 'lib/webdrone/text.rb', line 57

def page_title
  @a0.driver.title
rescue => exception
  Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end

#xpath(text, n: 1, all: false, visible: true) ⇒ Object



51
52
53
54
55
# File 'lib/webdrone/text.rb', line 51

def xpath(text, n: 1, all: false, visible: true)
  @a0.find.xpath(text, n: n, all: all, visible: visible).text
rescue => exception
  Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end