Skip to content

Upgrade selenium 4 ruby examples & rendering issue #1695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
49af31b
Expand options documentation test and examples
aguspe Apr 19, 2024
711c3c2
Merge branch 'trunk' into expand_options_example_page
aguspe Apr 19, 2024
f8f7c1d
Merge branch 'trunk' into expand_options_example_page
aguspe Apr 21, 2024
65d3aeb
Merge branch 'trunk' into expand_options_example_page
aguspe Apr 21, 2024
fd90d6e
Merge branch 'trunk' into expand_options_example_page
aguspe Apr 22, 2024
11eb35e
Merge branch 'trunk' into expand_options_example_page
aguspe Apr 23, 2024
c591765
Merge branch 'trunk' into expand_options_example_page
aguspe Apr 23, 2024
0c9738a
Merge branch 'trunk' into expand_options_example_page
aguspe Apr 24, 2024
919d47c
Update timeouts examples
aguspe Apr 24, 2024
846a11a
Merge remote-tracking branch 'origin/expand_options_example_page' int…
aguspe Apr 24, 2024
af36eaa
Update all navigations
aguspe Apr 24, 2024
a7a8b92
Merge branch 'trunk' into expand_options_example_page
aguspe Apr 24, 2024
4ce8459
Update options after updating the tests
aguspe Apr 25, 2024
ac5be92
Merge remote-tracking branch 'origin/expand_options_example_page' int…
aguspe Apr 25, 2024
b7b76f7
Merge branch 'trunk' into expand_options_example_page
aguspe Apr 25, 2024
8277f06
Merge branch 'trunk' into expand_options_example_page
aguspe Apr 25, 2024
5bc74d7
Update options after updating the tests
aguspe Apr 25, 2024
165749a
Fix documentation bug
aguspe Apr 25, 2024
fe98ff5
Merge remote-tracking branch 'origin/expand_options_example_page' int…
aguspe Apr 25, 2024
5ae210d
Fix documentation issue and migrate ruby code
aguspe Apr 26, 2024
2121c57
Merge branch 'trunk' into update_selenium_4_ruby_examples
aguspe Apr 26, 2024
7d604f6
Merge branch 'trunk' into update_selenium_4_ruby_examples
aguspe Apr 27, 2024
291805b
Fix proxy documentation issue
aguspe Apr 27, 2024
8cc5f55
Merge branch 'trunk' into update_selenium_4_ruby_examples
harsha509 Apr 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions examples/ruby/spec/drivers/options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,16 @@
driver.get(url)
driver.quit
end

it 'sets capabilities in the pre-selenium 4 way', skip: 'this is example code that will not execute' do
caps = Selenium::WebDriver::Remote::Capabilities.firefox
caps[:platform] = 'Windows 10'
caps[:version] = '92'
caps[:build] = my_test_build
caps[:name] = my_test_name
driver = Selenium::WebDriver.for :remote, url: cloud_url, desired_capabilities: caps
driver.get(url)
driver.quit
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,10 @@ likely because the environment needs a proxy to be accessed.

Selenium WebDriver provides a way to proxy settings:

{{< tabpane langEqualsHeader=true >}}
{{< tabpane text=true >}}
{{< badge-examples >}}
{{< tab header="Java" >}}
{{% tab header="Java" %}}
```java
import org.openqa.selenium.Proxy;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
Expand All @@ -567,8 +568,10 @@ public class ProxyTest {
driver.quit();
}
}
{{< /tab >}}
{{< tab header="Python" >}}
```
{{% /tab %}}
{{% tab header="Python" %}}
```python
from selenium import webdriver

PROXY = "<HOST:PORT>"
Expand All @@ -582,9 +585,10 @@ webdriver.DesiredCapabilities.FIREFOX['proxy'] = {

with webdriver.Firefox() as driver:
driver.get("https://selenium.dev")

{{< /tab >}}
{{< tab header="CSharp" >}}
```
{{% /tab %}}
{{% tab header="CSharp" %}}
```CSharp
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;

Expand All @@ -601,11 +605,13 @@ IWebDriver driver = new ChromeDriver(options);
driver.Navigate().GoToUrl("https://www.selenium.dev/");
}
}
{{< /tab >}}
```
{{% /tab %}}
{{< tab header="Ruby" >}}
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L87-L88" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{% tab header="JavaScript" %}}
```javascript
let webdriver = require('selenium-webdriver');
let chrome = require('selenium-webdriver/chrome');
let proxy = require('selenium-webdriver/proxy');
Expand All @@ -624,8 +630,10 @@ finally {
await driver.quit();
}
}());
{{< /tab >}}
{{< tab header="Kotlin" >}}
```
{{% /tab %}}
{{% tab header="Kotlin" %}}
```kotlin
import org.openqa.selenium.Proxy
import org.openqa.selenium.WebDriver
import org.openqa.selenium.chrome.ChromeDriver
Expand All @@ -644,5 +652,6 @@ fun main() {
driver.quit()
}
}
{{< /tab >}}
```
{{% /tab %}}
{{< /tabpane >}}
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,10 @@ Seleniumを使用した自動化スクリプト用のプロキシサーバーは
Selenium WebDriverは設定をプロキシする方法を提供します。


{{< tabpane langEqualsHeader=true >}}
{{< tab header="Java" >}}
{{< tabpane text=true >}}
{{< badge-examples >}}
{{% tab header="Java" %}}
```java
import org.openqa.selenium.Proxy;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
Expand All @@ -540,8 +542,10 @@ public class ProxyTest {
driver.quit();
}
}
{{< /tab >}}
{{< tab header="Python" >}}
```
{{% /tab %}}
{{% tab header="Python" %}}
```python
from selenium import webdriver

PROXY = "<HOST:PORT>"
Expand All @@ -554,11 +558,11 @@ webdriver.DesiredCapabilities.FIREFOX['proxy'] = {
}

with webdriver.Firefox() as driver:
# Open URL
driver.get("https://selenium.dev")

{{< /tab >}}
{{< tab header="CSharp" >}}
```
{{% /tab %}}
{{% tab header="CSharp" %}}
```CSharp
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;

Expand All @@ -575,11 +579,13 @@ IWebDriver driver = new ChromeDriver(options);
driver.Navigate().GoToUrl("https://www.selenium.dev/");
}
}
{{< /tab >}}
```
{{% /tab %}}
{{< tab header="Ruby" >}}
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L87-L88" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{% tab header="JavaScript" %}}
```javascript
let webdriver = require('selenium-webdriver');
let chrome = require('selenium-webdriver/chrome');
let proxy = require('selenium-webdriver/proxy');
Expand All @@ -598,8 +604,10 @@ finally {
await driver.quit();
}
}());
{{< /tab >}}
{{< tab header="Kotlin" >}}
```
{{% /tab %}}
{{% tab header="Kotlin" %}}
```kotlin
import org.openqa.selenium.Proxy
import org.openqa.selenium.WebDriver
import org.openqa.selenium.chrome.ChromeDriver
Expand All @@ -618,5 +626,6 @@ fun main() {
driver.quit()
}
}
{{< /tab >}}
```
{{% /tab %}}
{{< /tabpane >}}
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,10 @@ likely because the environment needs a proxy to be accessed.

Selenium WebDriver provides a way to proxy settings:

{{< tabpane langEqualsHeader=true >}}
{{< tab header="Java" >}}
{{< tabpane text=true >}}
{{< badge-examples >}}
{{% tab header="Java" %}}
```java
import org.openqa.selenium.Proxy;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
Expand All @@ -582,8 +584,10 @@ public class ProxyTest {
driver.quit();
}
}
{{< /tab >}}
{{< tab header="Python" >}}
```
{{% /tab %}}
{{% tab header="Python" %}}
```python
from selenium import webdriver

PROXY = "<HOST:PORT>"
Expand All @@ -597,9 +601,10 @@ webdriver.DesiredCapabilities.FIREFOX['proxy'] = {

with webdriver.Firefox() as driver:
driver.get("https://selenium.dev")

{{< /tab >}}
{{< tab header="CSharp" >}}
```
{{% /tab %}}
{{% tab header="CSharp" %}}
```CSharp
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;

Expand All @@ -616,11 +621,13 @@ IWebDriver driver = new ChromeDriver(options);
driver.Navigate().GoToUrl("https://www.selenium.dev/");
}
}
{{< /tab >}}
```
{{% /tab %}}
{{< tab header="Ruby" >}}
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L87-L88" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{% tab header="JavaScript" %}}
```javascript
let webdriver = require('selenium-webdriver');
let chrome = require('selenium-webdriver/chrome');
let proxy = require('selenium-webdriver/proxy');
Expand All @@ -639,8 +646,10 @@ finally {
await driver.quit();
}
}());
{{< /tab >}}
{{< tab header="Kotlin" >}}
```
{{% /tab %}}
{{% tab header="Kotlin" %}}
```kotlin
import org.openqa.selenium.Proxy
import org.openqa.selenium.WebDriver
import org.openqa.selenium.chrome.ChromeDriver
Expand All @@ -659,5 +668,6 @@ fun main() {
driver.quit()
}
}
{{< /tab >}}
```
{{% /tab %}}
{{< /tabpane >}}
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,10 @@ WebDriver创建新会话时,

Selenium WebDriver提供了如下设置代理的方法

{{< tabpane langEqualsHeader=true >}}
{{< tab header="Java" >}}
{{< tabpane text=true >}}
{{< badge-examples >}}
{{% tab header="Java" %}}
```java
import org.openqa.selenium.Proxy;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
Expand All @@ -569,8 +571,10 @@ public class ProxyTest {
driver.quit();
}
}
{{< /tab >}}
{{< tab header="Python" >}}
```
{{% /tab %}}
{{% tab header="Python" %}}
```python
from selenium import webdriver

PROXY = "<HOST:PORT>"
Expand All @@ -583,11 +587,11 @@ webdriver.DesiredCapabilities.FIREFOX['proxy'] = {
}

with webdriver.Firefox() as driver:
# Open URL
driver.get("https://selenium.dev")

{{< /tab >}}
{{< tab header="CSharp" >}}
```
{{% /tab %}}
{{% tab header="CSharp" %}}
```CSharp
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;

Expand All @@ -604,11 +608,13 @@ IWebDriver driver = new ChromeDriver(options);
driver.Navigate().GoToUrl("https://www.selenium.dev/");
}
}
{{< /tab >}}
```
{{% /tab %}}
{{< tab header="Ruby" >}}
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L87-L88" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{% tab header="JavaScript" %}}
```javascript
let webdriver = require('selenium-webdriver');
let chrome = require('selenium-webdriver/chrome');
let proxy = require('selenium-webdriver/proxy');
Expand All @@ -627,8 +633,10 @@ finally {
await driver.quit();
}
}());
{{< /tab >}}
{{< tab header="Kotlin" >}}
```
{{% /tab %}}
{{% tab header="Kotlin" %}}
```kotlin
import org.openqa.selenium.Proxy
import org.openqa.selenium.WebDriver
import org.openqa.selenium.chrome.ChromeDriver
Expand All @@ -647,5 +655,6 @@ fun main() {
driver.quit()
}
}
{{< /tab >}}
```
{{% /tab %}}
{{< /tabpane >}}
Loading
Loading