lib/webdrone/form.rb in webdrone-1.8.2 vs lib/webdrone/form.rb in webdrone-1.8.4
- old
+ new
@@ -120,10 +120,18 @@
item.click
rescue StandardError => error
Webdrone.report_error(@a0, error)
end
+ def selected?(key, n: 1, visible: true, scroll: false, parent: nil, mark: false)
+ item = find_item(key, n: n, visible: visible, scroll: scroll, parent: parent)
+ @a0.mark.mark_item item if mark
+ item.selected?
+ rescue StandardError => error
+ Webdrone.report_error(@a0, error)
+ end
+
def mark(key, n: 1, visible: true, scroll: false, parent: nil, color: '#af1616', times: nil, delay: nil, shot: nil)
@a0.mark.mark_item find_item(key, n: n, visible: visible, scroll: scroll, parent: parent), color: color, times: times, delay: delay, shot: shot
rescue StandardError => error
Webdrone.report_error(@a0, error)
end
@@ -141,11 +149,9 @@
set k, v
end
rescue StandardError => error
Webdrone.report_error(@a0, error)
end
-
- protected
def find_item(key, n: 1, visible: true, scroll: false, parent: nil)
@lastitem = \
if @xpath.respond_to? :call
@a0.find.xpath @xpath.call(key).to_s, n: n, visible: visible, scroll: scroll, parent: parent