Class: Selenium::WebDriver::Element
- Inherits:
-
Object
- Object
- Selenium::WebDriver::Element
- Defined in:
- lib/appium_lib_core/patch.rb
Overview
Implement useful features for element. Patch for Selenium Webdriver.
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.
Instance Method Details
#label ⇒ String
Enable access to iOS accessibility label accessibility identifier is supported as ‘name’
46 47 48 |
# File 'lib/appium_lib_core/patch.rb', line 46 def label attribute :label end |
#location_rel(driver) ⇒ ::Selenium::WebDriver::Point
For use with location_rel.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/appium_lib_core/patch.rb', line 62 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
33 34 35 |
# File 'lib/appium_lib_core/patch.rb', line 33 def name attribute :name end |
#value ⇒ String
Returns the value attribute
Fixes NoMethodError: undefined method ‘value’ for Selenium::WebDriver::Element for iOS
19 20 21 |
# File 'lib/appium_lib_core/patch.rb', line 19 def value attribute :value end |