Class: Selenium::WebDriver::Element
- Inherits:
-
Object
- Object
- Selenium::WebDriver::Element
- Defined in:
- lib/appium_lib/common/patch.rb
Overview
Implement useful features for element.
Instance Method Summary collapse
-
#location_rel ⇒ OpenStruct
For use with mobile tap.
-
#name ⇒ Object
Returns the name attribute.
-
#tag_name ⇒ Object
Returns the type attribute.
-
#value ⇒ Object
Returns the value attribute.
Instance Method Details
#location_rel ⇒ OpenStruct
For use with mobile tap.
“‘ruby execute_script ’mobile: tap’, :x => 0.0, :y => 0.98 “‘
58 59 60 61 62 63 |
# File 'lib/appium_lib/common/patch.rb', line 58 def location_rel xy = self.location w = window_size OpenStruct.new( x: xy.x.to_f / w.width.to_f, y: xy.y.to_f / w.height.to_f ) end |
#name ⇒ Object
Returns the name attribute
Fixes NoMethodError: undefined method ‘name’ for Selenium::WebDriver::Element
39 40 41 |
# File 'lib/appium_lib/common/patch.rb', line 39 def name self.attribute :name end |
#tag_name ⇒ Object
Returns the type attribute
Fixes Selenium::WebDriver::Error::UnknownError: Not yet implemented
46 47 48 |
# File 'lib/appium_lib/common/patch.rb', line 46 def tag_name self.attribute :type end |
#value ⇒ Object
Returns the value attribute
Fixes NoMethodError: undefined method ‘value’ for Selenium::WebDriver::Element
32 33 34 |
# File 'lib/appium_lib/common/patch.rb', line 32 def value self.attribute :value end |