Skip to content

Commit 280158b

Browse files
committed
Move upgrade to selenium examples
1 parent e2e4511 commit 280158b

File tree

5 files changed

+17
-32
lines changed

5 files changed

+17
-32
lines changed

examples/ruby/spec/drivers/options_spec.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,18 @@
3232
driver.get('https://www.google.com')
3333
driver.quit
3434
end
35+
36+
it 'sets remote capabilities' do
37+
options = Selenium::WebDriver::Options.firefox
38+
options.browser_version = 'latest'
39+
options.platform_name = 'Windows 10'
40+
cloud_options = {}
41+
cloud_options[:build] = my_test_build
42+
cloud_options[:name] = my_test_name
43+
options.add_option('cloud:options', cloud_options)
44+
driver = Selenium::WebDriver.for :remote, url: cloud_url, capabilities: options
45+
driver.get('https://www.google.com')
46+
driver.quit
47+
end
3548
end
3649
end

website_and_docs/content/documentation/webdriver/troubleshooting/upgrade_to_selenium_4.en.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,7 @@ browserOptions.AddAdditionalOption("cloud:options", cloudOptions);
135135
var driver = new RemoteWebDriver(new Uri(CloudURL), browserOptions);
136136
{{< /tab >}}
137137
{{< tab header="Ruby" >}}
138-
options = Selenium::WebDriver::Options.firefox
139-
options.browser_version = 'latest'
140-
options.platform_name = 'Windows 10'
141-
cloud_options = {}
142-
cloud_options[:build] = my_test_build
143-
cloud_options[:name] = my_test_name
144-
options.add_option('cloud:options', cloud_options)
145-
driver = Selenium::WebDriver.for :remote, url: cloud_url, capabilities: options
138+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L37-L46">}}
146139
{{< /tab >}}
147140
{{< tab header="Python" >}}
148141
from selenium.webdriver.firefox.options import Options as FirefoxOptions

website_and_docs/content/documentation/webdriver/troubleshooting/upgrade_to_selenium_4.ja.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,7 @@ browserOptions.AddAdditionalOption("cloud:options", cloudOptions);
129129
var driver = new RemoteWebDriver(new Uri(CloudURL), browserOptions);
130130
{{< /tab >}}
131131
{{< tab header="Ruby" >}}
132-
options = Selenium::WebDriver::Options.firefox
133-
options.browser_version = 'latest'
134-
options.platform_name = 'Windows 10'
135-
cloud_options = {}
136-
cloud_options[:build] = my_test_build
137-
cloud_options[:name] = my_test_name
138-
options.add_option('cloud:options', cloud_options)
139-
driver = Selenium::WebDriver.for :remote, url: cloud_url, capabilities: options
132+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L37-L46">}}
140133
{{< /tab >}}
141134
{{< tab header="Python" >}}
142135
from selenium.webdriver.firefox.options import Options as FirefoxOptions

website_and_docs/content/documentation/webdriver/troubleshooting/upgrade_to_selenium_4.pt-br.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,7 @@ browserOptions.AddAdditionalOption("cloud:options", cloudOptions);
132132
var driver = new RemoteWebDriver(new Uri(CloudURL), browserOptions);
133133
{{< /tab >}}
134134
{{< tab header="Ruby" >}}
135-
options = Selenium::WebDriver::Options.firefox
136-
options.browser_version = 'latest'
137-
options.platform_name = 'Windows 10'
138-
cloud_options = {}
139-
cloud_options[:build] = my_test_build
140-
cloud_options[:name] = my_test_name
141-
options.add_option('cloud:options', cloud_options)
142-
driver = Selenium::WebDriver.for :remote, url: cloud_url, capabilities: options
135+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L37-L46">}}
143136
{{< /tab >}}
144137
{{< tab header="Python" >}}
145138
from selenium.webdriver.firefox.options import Options as FirefoxOptions

website_and_docs/content/documentation/webdriver/troubleshooting/upgrade_to_selenium_4.zh-cn.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,7 @@ browserOptions.AddAdditionalOption("cloud: options", cloudOptions);
143143
var driver = new RemoteWebDriver(new Uri(CloudURL), browserOptions);
144144
{{< /tab >}}
145145
{{< tab header="Ruby" >}}
146-
options = Selenium: : WebDriver: : Options.firefox
147-
options.browser_version = 'latest'
148-
options.platform_name = 'Windows 10'
149-
cloud_options = {}
150-
cloud_options[: build] = my_test_build
151-
cloud_options[: name] = my_test_name
152-
options.add_option('cloud: options', cloud_options)
153-
driver = Selenium: : WebDriver.for : remote, url: cloud_url, capabilities: options
146+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L37-L46">}}
154147
{{< /tab >}}
155148
{{< tab header="Python" >}}
156149
from selenium.webdriver.firefox.options import Options as FirefoxOptions

0 commit comments

Comments
 (0)