Skip to content

Commit e0d00e1

Browse files
authored
Merge branch 'trunk' into final-python-pagesize-support
2 parents 99a6456 + ffe8d4b commit e0d00e1

File tree

3 files changed

+41
-16
lines changed

3 files changed

+41
-16
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@
44
Before submitting your PR, please check our [contributing](https://github.com/SeleniumHQ/selenium/blob/trunk/CONTRIBUTING.md) guidelines.
55
Avoid large PRs, help reviewers by making them as simple and short as possible.
66

7-
87
<!--- Provide a general summary of your changes in the Title above -->
98

10-
### Description
11-
<!--- Describe your changes in detail -->
12-
139
### Motivation and Context
1410
<!--- Why is this change required? What problem does it solve? -->
1511

README.md

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
1-
# Selenium
2-
3-
[![CI](https://github.com/SeleniumHQ/selenium/actions/workflows/ci.yml/badge.svg?branch=trunk&event=schedule)](https://github.com/SeleniumHQ/selenium/actions/workflows/ci.yml)
4-
[![CI - RBE](https://github.com/SeleniumHQ/selenium/actions/workflows/ci-rbe.yml/badge.svg?branch=trunk&event=schedule)](https://github.com/SeleniumHQ/selenium/actions/workflows/ci-rbe.yml)
5-
[![Releases downloads](https://img.shields.io/github/downloads/SeleniumHQ/selenium/total.svg)](https://github.com/SeleniumHQ/selenium/releases)
6-
7-
<a href="https://selenium.dev"><img src="common/images/selenium_logo_mark_green.svg" width="180" alt="Selenium Logo"/></a>
1+
<h1 align="center">
2+
<br/>
3+
<a href="https://selenium.dev"><img src="common/images/selenium_logo_mark_green.svg" alt="Selenium" width="100"></a>
4+
<br/>
5+
Selenium
6+
<br/>
7+
</h1>
8+
9+
<h3 align="center">Automates browsers. That's it!</h3>
10+
11+
<p align="center">
12+
<a href="#contributing">Contributing</a> •
13+
<a href="#installing">Installing</a> •
14+
<a href="#building">Building</a> •
15+
<a href="#developing">Developing</a> •
16+
<a href="#testing">Testing</a> •
17+
<a href="#documenting">Documenting</a> •
18+
<a href="#releasing">Releasing</a> •
19+
<a href="#license">License</a>
20+
</p>
21+
22+
<br>
823

924
Selenium is an umbrella project encapsulating a variety of tools and
1025
libraries enabling web browser automation. Selenium specifically
@@ -15,13 +30,15 @@ major web browsers.
1530
The project is made possible by volunteer contributors who've
1631
generously donated thousands of hours in code development and upkeep.
1732

18-
Selenium's source code is made available under the [Apache 2.0 license](https://github.com/SeleniumHQ/selenium/blob/trunk/LICENSE).
19-
2033
This README is for developers interested in contributing to the project.
2134
For people looking to get started using Selenium, please check out
2235
our [User Manual](https://selenium.dev/documentation/) for detailed examples and descriptions, and if you
2336
get stuck, there are several ways to [Get Help](https://www.selenium.dev/support/).
2437

38+
[![CI](https://github.com/SeleniumHQ/selenium/actions/workflows/ci.yml/badge.svg)](https://github.com/SeleniumHQ/selenium/actions/workflows/ci.yml)
39+
[![CI - RBE](https://github.com/SeleniumHQ/selenium/actions/workflows/ci-rbe.yml/badge.svg)](https://github.com/SeleniumHQ/selenium/actions/workflows/ci-rbe.yml)
40+
[![Releases downloads](https://img.shields.io/github/downloads/SeleniumHQ/selenium/total.svg)](https://github.com/SeleniumHQ/selenium/releases)
41+
2542
## Contributing
2643

2744
Please read [CONTRIBUTING.md](https://github.com/SeleniumHQ/selenium/blob/trunk/CONTRIBUTING.md)
@@ -507,3 +524,7 @@ If you have access to the Selenium EngFlow repository, you can have the assets b
507524
```shell
508525
./go all:release['--config', 'release']
509526
```
527+
528+
## License
529+
530+
Selenium's source code is made available under the [Apache 2.0 license](https://github.com/SeleniumHQ/selenium/blob/trunk/LICENSE).

dotnet/src/webdriver/BiDi/WebDriver.Extensions.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// </copyright>
1919

2020
using OpenQA.Selenium.BiDi.Modules.BrowsingContext;
21+
using System;
2122
using System.Threading.Tasks;
2223

2324
#nullable enable
@@ -28,11 +29,18 @@ public static class WebDriverExtensions
2829
{
2930
public static async Task<BiDi> AsBiDiAsync(this IWebDriver webDriver)
3031
{
31-
var webSocketUrl = ((IHasCapabilities)webDriver).Capabilities.GetCapability("webSocketUrl");
32+
if (webDriver is null) throw new ArgumentNullException(nameof(webDriver));
3233

33-
if (webSocketUrl is null) throw new System.Exception("The driver is not compatible with bidirectional protocol or it is not enabled in driver options.");
34+
string? webSocketUrl = null;
3435

35-
var bidi = await BiDi.ConnectAsync(webSocketUrl.ToString()!).ConfigureAwait(false);
36+
if (webDriver is IHasCapabilities hasCapabilities)
37+
{
38+
webSocketUrl = hasCapabilities.Capabilities.GetCapability("webSocketUrl")?.ToString();
39+
}
40+
41+
if (webSocketUrl is null) throw new BiDiException("The driver is not compatible with bidirectional protocol or \"webSocketUrl\" not enabled in driver options.");
42+
43+
var bidi = await BiDi.ConnectAsync(webSocketUrl).ConfigureAwait(false);
3644

3745
return bidi;
3846
}

0 commit comments

Comments
 (0)