Skip to content

Commit 7288b92

Browse files
Merge branch 'trunk' into Fix15697-5
2 parents c911b18 + c4c67d8 commit 7288b92

File tree

20 files changed

+107
-73
lines changed

20 files changed

+107
-73
lines changed

.github/workflows/ci-python.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ jobs:
2121
- name: Checkout source tree
2222
uses: actions/checkout@v4
2323
- name: Set up Python 3.9
24-
uses: actions/setup-python@v4
24+
uses: actions/setup-python@v6
2525
with:
2626
python-version: 3.9
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip
30-
pip install tox==4.27.0
30+
pip install tox==4.30.2
3131
- name: Generate docs
3232
run: tox -c py/tox.ini
3333
env:
@@ -41,13 +41,13 @@ jobs:
4141
- name: Checkout source tree
4242
uses: actions/checkout@v4
4343
- name: Set up Python 3.9
44-
uses: actions/setup-python@v4
44+
uses: actions/setup-python@v6
4545
with:
4646
python-version: 3.9
4747
- name: Install dependencies
4848
run: |
4949
python -m pip install --upgrade pip
50-
pip install tox==4.27.0
50+
pip install tox==4.30.2
5151
- name: Run type checking
5252
run: |
5353
tox -c py/tox.ini || true

.github/workflows/update-documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
distribution: 'temurin'
6969
- name: Set up Python 3.9
7070
if: ${{ inputs.language == 'py' || inputs.language == 'all' }}
71-
uses: actions/setup-python@v5
71+
uses: actions/setup-python@v6
7272
with:
7373
python-version: 3.9
7474
- name: Install dependencies

dotnet/src/webdriver/InvalidSelectorException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class InvalidSelectorException : WebDriverException
3030
/// <summary>
3131
/// Link to the documentation for this error
3232
/// </summary>
33-
private static string supportUrl = baseSupportUrl + "#invalid-selector-exception";
33+
private static string supportUrl = baseSupportUrl + "#invalidselectorexception";
3434

3535
/// <summary>
3636
/// Initializes a new instance of the <see cref="InvalidSelectorException"/> class.

dotnet/src/webdriver/NoSuchElementException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class NoSuchElementException : NotFoundException
3131
/// <summary>
3232
/// Link to the documentation for this error
3333
/// </summary>
34-
private static string supportUrl = baseSupportUrl + "#no-such-element-exception";
34+
private static string supportUrl = baseSupportUrl + "#nosuchelementexception";
3535

3636
/// <summary>
3737
/// Initializes a new instance of the <see cref="NoSuchElementException"/> class.

dotnet/src/webdriver/StaleElementReferenceException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class StaleElementReferenceException : WebDriverException
3030
/// <summary>
3131
/// Link to the documentation for this error
3232
/// </summary>
33-
private static string supportUrl = baseSupportUrl + "#stale-element-reference-exception";
33+
private static string supportUrl = baseSupportUrl + "#staleelementreferenceexception";
3434

3535
/// <summary>
3636
/// Initializes a new instance of the <see cref="StaleElementReferenceException"/> class.

dotnet/test/common/RelativeLocatorTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public void NearLocatorShouldNotFindFarElements()
224224
{
225225
var rect2 = driver.FindElement(RelativeBy.WithLocator(By.Id("rect4")).Near(rect));
226226

227-
}, Throws.TypeOf<NoSuchElementException>().With.Message.EqualTo("Unable to find element; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception"));
227+
}, Throws.TypeOf<NoSuchElementException>().With.Message.EqualTo("Unable to find element; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#nosuchelementexception"));
228228
}
229229

230230
//------------------------------------------------------------------

java/src/org/openqa/selenium/InvalidSelectorException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*/
2828
public class InvalidSelectorException extends WebDriverException {
2929

30-
private static final String SUPPORT_URL = BASE_SUPPORT_URL + "#invalid-selector-exception";
30+
private static final String SUPPORT_URL = BASE_SUPPORT_URL + "#invalidselectorexception";
3131

3232
public InvalidSelectorException(String reason) {
3333
super(reason);

java/src/org/openqa/selenium/NoSuchElementException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
@NullMarked
2828
public class NoSuchElementException extends NotFoundException {
2929

30-
private static final String SUPPORT_URL = BASE_SUPPORT_URL + "#no-such-element-exception";
30+
private static final String SUPPORT_URL = BASE_SUPPORT_URL + "#nosuchelementexception";
3131

3232
public NoSuchElementException(@Nullable String reason) {
3333
super(reason);

java/src/org/openqa/selenium/StaleElementReferenceException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
@NullMarked
2828
public class StaleElementReferenceException extends WebDriverException {
2929

30-
private static final String SUPPORT_URL = BASE_SUPPORT_URL + "#stale-element-reference-exception";
30+
private static final String SUPPORT_URL = BASE_SUPPORT_URL + "#staleelementreferenceexception";
3131

3232
public StaleElementReferenceException(@Nullable String message) {
3333
super(message);

py/selenium/webdriver/common/utils.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
"""The Utils methods."""
17+
18+
"""Utility functions."""
1819

1920
import socket
21+
import urllib.request
2022
from collections.abc import Iterable
2123
from typing import Optional, Union
2224

@@ -67,8 +69,8 @@ def find_connectable_ip(host: Union[str, bytes, bytearray, None], port: Optional
6769
port are considered.
6870
6971
:Args:
70-
- host - A hostname.
71-
- port - Optional port number.
72+
- host - hostname
73+
- port - port number
7274
7375
:Returns:
7476
A single IP address, as a string. If any IPv4 address is found, one is
@@ -100,8 +102,8 @@ def join_host_port(host: str, port: int) -> str:
100102
example, _join_host_port('::1', 80) == '[::1]:80'.
101103
102104
:Args:
103-
- host - A hostname.
104-
- port - An integer port.
105+
- host - hostname or IP
106+
- port - port number
105107
"""
106108
if ":" in host and not host.startswith("["):
107109
return f"[{host}]:{port}"
@@ -112,7 +114,8 @@ def is_connectable(port: int, host: Optional[str] = "localhost") -> bool:
112114
"""Tries to connect to the server at port to see if it is running.
113115
114116
:Args:
115-
- port - The port to connect.
117+
- port - port number
118+
- host - hostname or IP
116119
"""
117120
socket_ = None
118121
try:
@@ -130,18 +133,22 @@ def is_connectable(port: int, host: Optional[str] = "localhost") -> bool:
130133
return result
131134

132135

133-
def is_url_connectable(port: Union[int, str]) -> bool:
134-
"""Tries to connect to the HTTP server at /status path and specified port
135-
to see if it responds successfully.
136+
def is_url_connectable(
137+
port: Union[int, str],
138+
host: Optional[str] = "127.0.0.1",
139+
scheme: Optional[str] = "http",
140+
) -> bool:
141+
"""Sends a request to the HTTP server at the /status endpoint to see if it
142+
responds successfully.
136143
137144
:Args:
138-
- port - The port to connect.
145+
- port - port number
146+
- host - hostname or IP
147+
- scheme - URL scheme
139148
"""
140-
from urllib import request as url_request
141-
142149
try:
143-
res = url_request.urlopen(f"http://127.0.0.1:{port}/status")
144-
return res.getcode() == 200
150+
with urllib.request.urlopen(f"{scheme}://{host}:{port}/status") as res:
151+
return res.getcode() == 200
145152
except Exception:
146153
return False
147154

0 commit comments

Comments
 (0)