Skip to content

Commit ee8e280

Browse files
committed
Add Driver#remote_status for the Ruby remote driver. Fixes issue 5669.
1 parent 1940505 commit ee8e280

File tree

6 files changed

+30
-3
lines changed

6 files changed

+30
-3
lines changed

rb/CHANGES

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
2.34.0 (???)
22
============
33

4+
* Add `Driver#remote_status` to the remote driver (#5669)
5+
46
2.33.0 (2013-05-26)
57
===================
68

79
Remote:
810
* Support rotating devices, such as iPhone & iPad in simulator and Android browser in emulator
911
* Support for interacting with touch screen devices, such as iPhone & iPad in simulator and Android browser in emulator
10-
* Improve error messages for invalid wire protocol responses
12+
* Improve error messages for invalid wire protocol responses
1113
Chrome:
1214
* Accept :service_log_path for Chrome. (#3475)
13-
IE:
15+
IE:
1416
* IE >=9 versions triggerMouseEvent like other browsers (#2218).
1517
Various:
1618
* Element#text ignores elements in <head>

rb/lib/selenium/webdriver/common.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
require 'selenium/webdriver/common/driver_extensions/has_location'
3434
require 'selenium/webdriver/common/driver_extensions/has_session_id'
3535
require 'selenium/webdriver/common/driver_extensions/has_touch_screen'
36+
require 'selenium/webdriver/common/driver_extensions/has_remote_status'
3637
require 'selenium/webdriver/common/driver_extensions/uploads_files'
3738
require 'selenium/webdriver/common/keys'
3839
require 'selenium/webdriver/common/bridge_helper'
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module Selenium
2+
module WebDriver
3+
module DriverExtensions
4+
module HasRemoteStatus
5+
6+
def remote_status
7+
@bridge.status
8+
end
9+
10+
end
11+
end
12+
end
13+
end

rb/lib/selenium/webdriver/remote/bridge.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ def driver_extensions
8282
DriverExtensions::TakesScreenshot,
8383
DriverExtensions::HasSessionId,
8484
DriverExtensions::Rotatable,
85-
DriverExtensions::HasTouchScreen
85+
DriverExtensions::HasTouchScreen,
86+
DriverExtensions::HasRemoteStatus
8687
]
8788
end
8889

@@ -101,6 +102,10 @@ def create_session(desired_capabilities)
101102
Capabilities.json_create resp['value']
102103
end
103104

105+
def status
106+
execute :status
107+
end
108+
104109
def get(url)
105110
execute :get, {}, :url => url
106111
end

rb/lib/selenium/webdriver/remote/commands.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class Selenium::WebDriver::Remote::Bridge
77

88
command :newSession, :post, "session"
99
command :getCapabilities, :get, "session/:session_id"
10+
command :status, :get, "status"
1011

1112
#
1213
# basic driver

rb/spec/integration/selenium/webdriver/remote/driver_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ module Remote
66
it "should expose session_id" do
77
driver.session_id.should be_kind_of(String)
88
end
9+
10+
it "should expose remote status" do
11+
driver.should be_kind_of(DriverExtensions::HasRemoteStatus)
12+
driver.remote_status.should be_kind_of(Hash)
13+
end
914
end
1015

1116
end # Remote

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy