Class: Selenium::WebDriver::Element
- Inherits:
-
Object
- Object
- Selenium::WebDriver::Element
- Includes:
- Appium::Core::Base::SearchContext
- Defined in:
- lib/appium_lib_core/patch.rb
Overview
Implement useful features for element. Patch for Selenium Webdriver.
Constant Summary
Constants included from Appium::Core::Base::SearchContext
Appium::Core::Base::SearchContext::FINDERS
Instance Method Summary collapse
-
#label ⇒ String
Enable access to iOS accessibility label accessibility identifier is supported as ‘name’.
-
#location_rel(driver) ⇒ ::Selenium::WebDriver::Point
For use with location_rel.
-
#name ⇒ String
Returns the name attribute.
-
#value ⇒ String
Returns the value attribute.
Methods included from Appium::Core::Base::SearchContext
add_finders, #find_element, #find_elements
Instance Method Details
#label ⇒ String
Enable access to iOS accessibility label accessibility identifier is supported as ‘name’
49 50 51 |
# File 'lib/appium_lib_core/patch.rb', line 49 def label attribute :label end |
#location_rel(driver) ⇒ ::Selenium::WebDriver::Point
For use with location_rel.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/appium_lib_core/patch.rb', line 65 def location_rel(driver) rect = self.rect location_x = rect.x.to_f location_y = rect.y.to_f size_width = rect.width.to_f size_height = rect.height.to_f center_x = location_x + (size_width / 2.0) center_y = location_y + (size_height / 2.0) w = driver.window_size ::Selenium::WebDriver::Point.new "#{center_x} / #{w.width.to_f}", "#{center_y} / #{w.height.to_f}" end |
#name ⇒ String
Returns the name attribute
Fixes NoMethodError: undefined method ‘name’ for Selenium::WebDriver::Element for iOS
36 37 38 |
# File 'lib/appium_lib_core/patch.rb', line 36 def name attribute :name end |
#value ⇒ String
Returns the value attribute
Fixes NoMethodError: undefined method ‘value’ for Selenium::WebDriver::Element for iOS
22 23 24 |
# File 'lib/appium_lib_core/patch.rb', line 22 def value attribute :value end |