Class: Appium::Core::Base::Driver
- Inherits:
-
Selenium::WebDriver::Driver
- Object
- Selenium::WebDriver::Driver
- Appium::Core::Base::Driver
- Includes:
- SearchContext, Selenium::WebDriver::DriverExtensions::HasRemoteStatus, Selenium::WebDriver::DriverExtensions::HasSessionId, Selenium::WebDriver::DriverExtensions::HasWebStorage, Selenium::WebDriver::DriverExtensions::Rotatable, Selenium::WebDriver::DriverExtensions::TakesScreenshot, Selenium::WebDriver::DriverExtensions::UploadsFiles
- Defined in:
- lib/appium_lib_core/common/base/driver.rb
Constant Summary
Constants included from SearchContext
Instance Method Summary collapse
-
#back ⇒ String
Get the device window’s size.
-
#dialect ⇒ :oss|:w3c
Get the dialect value.
-
#get_timeouts ⇒ Hash
For W3C.
-
#initialize(opts = {}) ⇒ Driver
constructor
A new instance of Driver.
-
#logs ⇒ String
Get the device window’s logs.
-
#session_capabilities ⇒ Selenium::WebDriver::Remote::Capabilities
Retrieve the capabilities of the specified session.
-
#window_rect ⇒ Selenium::WebDriver::Rectangle
Get the device window’s rect.
-
#window_size ⇒ Selenium::WebDriver::Dimension
Get the device window’s size.
Methods included from SearchContext
add_finders, #find_element, #find_elements
Constructor Details
#initialize(opts = {}) ⇒ Driver
Returns a new instance of Driver.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/appium_lib_core/common/base/driver.rb', line 16 def initialize(opts = {}) listener = opts.delete(:listener) @bridge = ::Appium::Core::Base::Bridge.handshake(opts) if @bridge.dialect == :oss # MJSONWP extend ::Selenium::WebDriver::DriverExtensions::HasTouchScreen extend ::Selenium::WebDriver::DriverExtensions::HasLocation extend ::Selenium::WebDriver::DriverExtensions::HasNetworkConnection elsif @bridge.dialect == :w3c # TODO: Only for Appium. Ideally, we'd like to remove the below like selenium-webdriver extend ::Selenium::WebDriver::DriverExtensions::HasTouchScreen extend ::Selenium::WebDriver::DriverExtensions::HasLocation extend ::Selenium::WebDriver::DriverExtensions::HasNetworkConnection end super(@bridge, listener: listener) end |
Instance Method Details
#back ⇒ String
Get the device window’s size.
70 71 72 |
# File 'lib/appium_lib_core/common/base/driver.rb', line 70 def back navigate.back end |
#dialect ⇒ :oss|:w3c
Get the dialect value
34 35 36 |
# File 'lib/appium_lib_core/common/base/driver.rb', line 34 def dialect @bridge.dialect end |
#get_timeouts ⇒ Hash
For W3C. Get the timeout related settings on the server side.
94 95 96 |
# File 'lib/appium_lib_core/common/base/driver.rb', line 94 def get_timeouts @bridge.get_timeouts end |
#logs ⇒ String
Get the device window’s logs.
82 83 84 |
# File 'lib/appium_lib_core/common/base/driver.rb', line 82 def logs @logs ||= Logs.new(@bridge) end |
#session_capabilities ⇒ Selenium::WebDriver::Remote::Capabilities
Retrieve the capabilities of the specified session. It’s almost same as ‘@driver.capabilities` but you can get more details.
183 184 185 |
# File 'lib/appium_lib_core/common/base/driver.rb', line 183 def session_capabilities @bridge.session_capabilities end |
#window_rect ⇒ Selenium::WebDriver::Rectangle
Get the device window’s rect.
60 61 62 |
# File 'lib/appium_lib_core/common/base/driver.rb', line 60 def window_rect manage.window.rect end |
#window_size ⇒ Selenium::WebDriver::Dimension
Get the device window’s size.
46 47 48 |
# File 'lib/appium_lib_core/common/base/driver.rb', line 46 def window_size manage.window.size end |