Class: Aranha::Selenium::Session::Element
- Inherits:
-
Object
- Object
- Aranha::Selenium::Session::Element
- Defined in:
- lib/aranha/selenium/session/element.rb
Instance Method Summary collapse
- #click ⇒ Boolean
- #click! ⇒ self
- #find ⇒ Selenium::WebDriver::Element?
- #find! ⇒ Selenium::WebDriver::Element
- #wait_click(*session_wait_args, &block) ⇒ self
Instance Method Details
#click ⇒ Boolean
12 13 14 15 16 17 18 19 20 |
# File 'lib/aranha/selenium/session/element.rb', line 12 def click click! true rescue ::Selenium::WebDriver::Error::ElementClickInterceptedError, ::Selenium::WebDriver::Error::ElementNotInteractableError, ::Selenium::WebDriver::Error::NoSuchElementError, ::Selenium::WebDriver::Error::StaleElementReferenceError false end |
#click! ⇒ self
27 28 29 30 31 |
# File 'lib/aranha/selenium/session/element.rb', line 27 def click! find!.click self end |
#find ⇒ Selenium::WebDriver::Element?
34 35 36 37 |
# File 'lib/aranha/selenium/session/element.rb', line 34 def find r = session.find_elements(*find_args) r.any? ? r.first : nil end |
#find! ⇒ Selenium::WebDriver::Element
41 42 43 44 45 46 |
# File 'lib/aranha/selenium/session/element.rb', line 41 def find! return find_args.first if find_args.count >= 1 && find_args.first.is_a?(::Selenium::WebDriver::Element) session.__getobj__.find_element(*find_args) end |
#wait_click(*session_wait_args, &block) ⇒ self
50 51 52 53 54 55 56 |
# File 'lib/aranha/selenium/session/element.rb', line 50 def wait_click(*session_wait_args, &block) session.wait(*session_wait_args).until do block.if_present(&:call) click end self end |