Skip to content

Commit 3fcbd56

Browse files
Merge branch 'trunk' into improve_docs
2 parents fcf23f0 + 052bb25 commit 3fcbd56

9 files changed

Lines changed: 204 additions & 246 deletions

File tree

examples/python/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ trio==0.31.0
44
pytest-trio==0.8.0
55
pytest-rerunfailures==16.1
66
flake8==7.3.0
7-
requests==2.32.5
7+
requests==2.33.0
88
tox==4.32.0
99
pytest-xdist==3.8.0
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,58 @@
1+
import pytest
12
from selenium import webdriver
3+
from selenium.webdriver.support.ui import WebDriverWait
4+
from selenium.webdriver.common.by import By
5+
from selenium.webdriver.support import expected_conditions as EC
26

7+
url = "https://www.selenium.dev/selenium/web/window_switching_tests/page_with_frame.html"
8+
9+
@pytest.fixture()
10+
def driver():
11+
driver = webdriver.Chrome()
12+
yield driver
13+
driver.quit()
14+
15+
def test_current_window_handle(driver):
16+
driver.get(url)
17+
current_handle = driver.current_window_handle
18+
assert current_handle is not None
19+
20+
21+
def test_switch_to_window(driver):
22+
driver.get(url)
23+
wait = WebDriverWait(driver, 10)
24+
25+
original_window_handle = driver.current_window_handle
26+
27+
driver.find_element(By.LINK_TEXT, "Open new window").click()
28+
wait.until(EC.number_of_windows_to_be(2))
29+
30+
new_window_handle = (set(driver.window_handles) - {original_window_handle}).pop()
31+
driver.switch_to.window(new_window_handle)
32+
assert driver.current_window_handle == new_window_handle
33+
34+
def test_close_window(driver):
35+
driver.get(url)
36+
wait = WebDriverWait(driver, 10)
37+
38+
original_window_handle = driver.current_window_handle
39+
40+
driver.find_element(By.LINK_TEXT, "Open new window").click()
41+
wait.until(EC.number_of_windows_to_be(2))
42+
43+
new_window_handle = (set(driver.window_handles) - {original_window_handle}).pop()
44+
driver.switch_to.window(new_window_handle)
45+
46+
driver.close()
47+
driver.switch_to.window(original_window_handle)
48+
49+
assert driver.current_window_handle == original_window_handle
50+
assert len(driver.window_handles) == 1
51+
52+
def test_create_new_window(driver):
53+
# Opens a new tab and switches to new tab
54+
driver.switch_to.new_window('tab')
55+
assert driver.title == ""
56+
# Opens a new window and switches to new window
57+
driver.switch_to.new_window('window')
58+
assert driver.title == ""
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: ".NET Assemblies Are Now Strongly Signed"
3+
linkTitle: ".NET Assemblies Are Now Strongly Signed"
4+
date: 2026-04-27
5+
tags: ["selenium", "dotnet"]
6+
categories: ["general"]
7+
author: Nikolay Borisenko [@nvborisenko](https://github.com/nvborisenko)
8+
description: >
9+
Starting with Selenium 4.44, the main NuGet packages ship strongly signed assemblies. The separate StrongNamed packages are retired.
10+
---
11+
12+
Starting with **Selenium 4.44**, the `Selenium.WebDriver` and `Selenium.Support` NuGet packages ship **strongly signed assemblies**. The separate `Selenium.WebDriver.StrongNamed` and `Selenium.Support.StrongNamed` packages are discontinued.
13+
14+
## Why This Matters
15+
16+
Without strong naming on the official packages, any project that itself needed to be strongly signed could not reference Selenium from NuGet. Teams were forced to either forgo strong naming, bundle out-of-band downloads, or use the separate `StrongNamed` packages with a different assembly name — all of which caused friction, especially in enterprise environments.
17+
18+
## What Changed
19+
20+
- `Selenium.WebDriver` and `Selenium.Support` are now strongly signed.
21+
Assembly names change: `WebDriver``Selenium.WebDriver`, `WebDriver.Support``Selenium.Support`.
22+
- `AssemblyVersion` stays at `4.0.0.0` (major-only) — no binding redirects needed between `4.x` releases.
23+
- `Selenium.WebDriver.StrongNamed` and `Selenium.Support.StrongNamed` are **retired**.
24+
25+
## Breaking Changes
26+
27+
If you reference the `StrongNamed` packages, migrate as follows:
28+
29+
1. Replace `Selenium.WebDriver.StrongNamed``Selenium.WebDriver`
30+
2. Replace `Selenium.Support.StrongNamed``Selenium.Support`
31+
3. Update assembly references: `WebDriver.StrongNamed``Selenium.WebDriver`, `WebDriver.Support.StrongNamed``Selenium.Support`
32+
33+
If you use the regular packages — the assemblies are now signed but the assembly names change (`WebDriver.dll``Selenium.WebDriver.dll`, `WebDriver.Support.dll``Selenium.Support.dll`), so update any explicit assembly references accordingly. The public API is unchanged.
34+
35+
## Related Issues
36+
37+
- [#12315](https://github.com/SeleniumHQ/selenium/issues/12315) — Publish StrongNamed builds to NuGet feed
38+
- [#10845](https://github.com/SeleniumHQ/selenium/issues/10845) — Revisiting strong-named assemblies for NuGet
39+
- [#14115](https://github.com/SeleniumHQ/selenium/issues/14115) — Strong Name Key
40+
41+
Implementation: [#17397](https://github.com/SeleniumHQ/selenium/pull/17397)

website_and_docs/content/documentation/webdriver/interactions/windows.en.md

Lines changed: 12 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ current window by using:
2222
{{< tab header="Java" text=true >}}
2323
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/WindowsTest.java#L16-L20" >}}
2424
{{< /tab >}}
25-
{{< tab header="Python" >}}driver.current_window_handle{{< /tab >}}
25+
{{< tab header="Python" text=true >}}
26+
{{< gh-codeblock path="/examples/python/tests/interactions/test_windows.py#L16-L18" >}}
27+
{{< /tab >}}
2628
{{< tab header="CSharp" text=true >}}
2729
{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/WindowsTest.cs#L17-L21" >}}
2830
{{< /tab >}}
@@ -46,38 +48,8 @@ window is launched. So first position will be default browser, and so on.
4648
{{< tab header="Java" text=true >}}
4749
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/WindowsTest.java#L22-L29" >}}
4850
{{< /tab >}}
49-
{{< tab header="Python" >}}
50-
from selenium import webdriver
51-
from selenium.webdriver.support.ui import WebDriverWait
52-
from selenium.webdriver.support import expected_conditions as EC
53-
54-
with webdriver.Firefox() as driver:
55-
# Open URL
56-
driver.get("https://seleniumhq.github.io")
57-
58-
# Setup wait for later
59-
wait = WebDriverWait(driver, 10)
60-
61-
# Store the ID of the original window
62-
original_window = driver.current_window_handle
63-
64-
# Check we don't have other windows open already
65-
assert len(driver.window_handles) == 1
66-
67-
# Click the link which opens in a new window
68-
driver.find_element(By.LINK_TEXT, "new window").click()
69-
70-
# Wait for the new window or tab
71-
wait.until(EC.number_of_windows_to_be(2))
72-
73-
# Loop through until we find a new window handle
74-
for window_handle in driver.window_handles:
75-
if window_handle != original_window:
76-
driver.switch_to.window(window_handle)
77-
break
78-
79-
# Wait for the new tab to finish loading content
80-
wait.until(EC.title_is("SeleniumHQ Browser Automation"))
51+
{{< tab header="Python" text=true >}}
52+
{{< gh-codeblock path="/examples/python/tests/interactions/test_windows.py#L22-L32" >}}
8153
{{< /tab >}}
8254

8355
{{< tab header="CSharp" text=true >}}
@@ -176,12 +148,8 @@ handle stored in a variable. Put this together and you will get:
176148
{{< tab header="Java" text=true >}}
177149
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/WindowsTest.java#L31-L34" >}}
178150
{{< /tab >}}
179-
{{< tab header="Python" >}}
180-
#Close the tab or window
181-
driver.close()
182-
183-
#Switch back to the old tab or window
184-
driver.switch_to.window(original_window)
151+
{{< tab header="Python" text=true >}}
152+
{{< gh-codeblock path="/examples/python/tests/interactions/test_windows.py#L46-L46" >}}
185153
{{< /tab >}}
186154

187155
{{< tab header="CSharp" text=true >}}
@@ -230,12 +198,8 @@ __Note: This feature works with Selenium 4 and later versions.__
230198
{{< tab header="Java" text=true >}}
231199
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/WindowsTest.java#L36-L42" >}}
232200
{{< /tab >}}
233-
{{< tab header="Python" >}}
234-
# Opens a new tab and switches to new tab
235-
driver.switch_to.new_window('tab')
236-
237-
# Opens a new window and switches to new window
238-
driver.switch_to.new_window('window')
201+
{{< tab header="Python" text=true >}}
202+
{{< gh-codeblock path="/examples/python/tests/interactions/test_windows.py#L53-L58" >}}
239203
{{< /tab >}}
240204

241205

@@ -278,7 +242,9 @@ instead of close:
278242
{{< tab header="Java" text=true >}}
279243
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/WindowsTest.java#L44-L45" >}}
280244
{{< /tab >}}
281-
{{< tab header="Python" >}}driver.quit(){{< /tab >}}
245+
{{< tab header="Python" text=true >}}
246+
{{< gh-codeblock path="/examples/python/tests/interactions/test_windows.py#L13-L13" >}}
247+
{{< /tab >}}
282248

283249
{{< tab header="CSharp" text=true >}}
284250
{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/WindowsTest.cs#L45-L46" >}}

website_and_docs/content/documentation/webdriver/interactions/windows.ja.md

Lines changed: 12 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ WebDriverは、ウィンドウとタブを区別しません。
2020
{{< tab header="Java" text=true >}}
2121
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/WindowsTest.java#L16-L20" >}}
2222
{{< /tab >}}
23-
{{< tab header="Python" >}}driver.current_window_handle{{< /tab >}}
23+
{{< tab header="Python" text=true >}}
24+
{{< gh-codeblock path="/examples/python/tests/interactions/test_windows.py#L16-L18" >}}
25+
{{< /tab >}}
2426
{{< tab header="CSharp" text=true >}}
2527
{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/WindowsTest.cs#L17-L21" >}}
2628
{{< /tab >}}
@@ -41,39 +43,8 @@ WebDriverは、ウィンドウとタブを区別しません。
4143
{{< tab header="Java" text=true >}}
4244
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/WindowsTest.java#L22-L29" >}}
4345
{{< /tab >}}
44-
{{< tab header="Python" >}}
45-
from selenium import webdriver
46-
from selenium.webdriver.support.ui import WebDriverWait
47-
from selenium.webdriver.support import expected_conditions as EC
48-
49-
# Start the driver
50-
with webdriver.Firefox() as driver:
51-
# Open URL
52-
driver.get("https://seleniumhq.github.io")
53-
54-
# Setup wait for later
55-
wait = WebDriverWait(driver, 10)
56-
57-
# Store the ID of the original window
58-
original_window = driver.current_window_handle
59-
60-
# Check we don't have other windows open already
61-
assert len(driver.window_handles) == 1
62-
63-
# Click the link which opens in a new window
64-
driver.find_element(By.LINK_TEXT, "new window").click()
65-
66-
# Wait for the new window or tab
67-
wait.until(EC.number_of_windows_to_be(2))
68-
69-
# Loop through until we find a new window handle
70-
for window_handle in driver.window_handles:
71-
if window_handle != original_window:
72-
driver.switch_to.window(window_handle)
73-
break
74-
75-
# Wait for the new tab to finish loading content
76-
wait.until(EC.title_is("SeleniumHQ Browser Automation"))
46+
{{< tab header="Python" text=true >}}
47+
{{< gh-codeblock path="/examples/python/tests/interactions/test_windows.py#L22-L32" >}}
7748
{{< /tab >}}
7849

7950
{{< tab header="CSharp" text=true >}}
@@ -169,12 +140,8 @@ wait.until(titleIs("Selenium documentation"))
169140
{{< tab header="Java" text=true >}}
170141
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/WindowsTest.java#L31-L34" >}}
171142
{{< /tab >}}
172-
{{< tab header="Python" >}}
173-
#Close the tab or window
174-
driver.close()
175-
176-
#Switch back to the old tab or window
177-
driver.switch_to.window(original_window)
143+
{{< tab header="Python" text=true >}}
144+
{{< gh-codeblock path="/examples/python/tests/interactions/test_windows.py#L46-L46" >}}
178145
{{< /tab >}}
179146

180147
{{< tab header="CSharp" text=true >}}
@@ -220,12 +187,8 @@ __注意: この機能は、Selenium 4以降のバージョンで機能します
220187
{{< tab header="Java" text=true >}}
221188
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/WindowsTest.java#L36-L42" >}}
222189
{{< /tab >}}
223-
{{< tab header="Python" >}}
224-
# Opens a new tab and switches to new tab
225-
driver.switch_to.new_window('tab')
226-
227-
# Opens a new window and switches to new window
228-
driver.switch_to.new_window('window')
190+
{{< tab header="Python" text=true >}}
191+
{{< gh-codeblock path="/examples/python/tests/interactions/test_windows.py#L53-L58" >}}
229192
{{< /tab >}}
230193

231194
{{< tab header="CSharp" text=true >}}
@@ -268,7 +231,9 @@ driver.switchTo().newWindow(WindowType.WINDOW)
268231
{{< tab header="Java" text=true >}}
269232
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/WindowsTest.java#L44-L45" >}}
270233
{{< /tab >}}
271-
{{< tab header="Python" >}}driver.quit(){{< /tab >}}
234+
{{< tab header="Python" text=true >}}
235+
{{< gh-codeblock path="/examples/python/tests/interactions/test_windows.py#L13-L13" >}}
236+
{{< /tab >}}
272237
{{< tab header="CSharp" text=true >}}
273238
{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/WindowsTest.cs#L45-L46" >}}
274239
{{< /tab >}}

website_and_docs/content/documentation/webdriver/interactions/windows.pt-br.md

Lines changed: 12 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ persistente em uma única sessão. Você pode pegar o identificador atual usando
2020
{{< tab header="Java" text=true >}}
2121
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/WindowsTest.java#L16-L20" >}}
2222
{{< /tab >}}
23-
{{< tab header="Python" >}}driver.current_window_handle{{< /tab >}}
23+
{{< tab header="Python" text=true >}}
24+
{{< gh-codeblock path="/examples/python/tests/interactions/test_windows.py#L16-L18" >}}
25+
{{< /tab >}}
2426
{{< tab header="CSharp" text=true >}}
2527
{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/WindowsTest.cs#L17-L21" >}}
2628
{{< /tab >}}
@@ -47,39 +49,8 @@ que cria uma nova guia (ou) nova janela e muda automaticamente para ela.
4749
{{< tab header="Java" text=true >}}
4850
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/WindowsTest.java#L22-L29" >}}
4951
{{< /tab >}}
50-
{{< tab header="Python" >}}
51-
from selenium import webdriver
52-
from selenium.webdriver.support.ui import WebDriverWait
53-
from selenium.webdriver.support import expected_conditions as EC
54-
55-
# Start the driver
56-
with webdriver.Firefox() as driver:
57-
# Open URL
58-
driver.get("https://seleniumhq.github.io")
59-
60-
# Setup wait for later
61-
wait = WebDriverWait(driver, 10)
62-
63-
# Store the ID of the original window
64-
original_window = driver.current_window_handle
65-
66-
# Check we don't have other windows open already
67-
assert len(driver.window_handles) == 1
68-
69-
# Click the link which opens in a new window
70-
driver.find_element(By.LINK_TEXT, "new window").click()
71-
72-
# Wait for the new window or tab
73-
wait.until(EC.number_of_windows_to_be(2))
74-
75-
# Loop through until we find a new window handle
76-
for window_handle in driver.window_handles:
77-
if window_handle != original_window:
78-
driver.switch_to.window(window_handle)
79-
break
80-
81-
# Wait for the new tab to finish loading content
82-
wait.until(EC.title_is("SeleniumHQ Browser Automation"))
52+
{{< tab header="Python" text=true >}}
53+
{{< gh-codeblock path="/examples/python/tests/interactions/test_windows.py#L22-L32" >}}
8354
{{< /tab >}}
8455

8556
{{< tab header="CSharp" text=true >}}
@@ -178,12 +149,8 @@ anterior armazenado em uma variável. Junte isso e você obterá:
178149
{{< tab header="Java" text=true >}}
179150
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/WindowsTest.java#L31-L34" >}}
180151
{{< /tab >}}
181-
{{< tab header="Python" >}}
182-
#Close the tab or window
183-
driver.close()
184-
185-
#Switch back to the old tab or window
186-
driver.switch_to.window(original_window)
152+
{{< tab header="Python" text=true >}}
153+
{{< gh-codeblock path="/examples/python/tests/interactions/test_windows.py#L46-L46" >}}
187154
{{< /tab >}}
188155

189156
{{< tab header="CSharp" text=true >}}
@@ -230,12 +197,8 @@ __Nota: este recurso funciona com Selenium 4 e versões posteriores.__
230197
{{< tab header="Java" text=true >}}
231198
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/WindowsTest.java#L36-L42" >}}
232199
{{< /tab >}}
233-
{{< tab header="Python" >}}
234-
# Opens a new tab and switches to new tab
235-
driver.switch_to.new_window('tab')
236-
237-
# Opens a new window and switches to new window
238-
driver.switch_to.new_window('window')
200+
{{< tab header="Python" text=true >}}
201+
{{< gh-codeblock path="/examples/python/tests/interactions/test_windows.py#L53-L58" >}}
239202
{{< /tab >}}
240203

241204
{{< tab header="CSharp" text=true >}}
@@ -279,7 +242,9 @@ em vez de fechar:
279242
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/WindowsTest.java#L44-L45" >}}
280243
{{< /tab >}}
281244

282-
{{< tab header="Python" >}}driver.quit(){{< /tab >}}
245+
{{< tab header="Python" text=true >}}
246+
{{< gh-codeblock path="/examples/python/tests/interactions/test_windows.py#L13-L13" >}}
247+
{{< /tab >}}
283248
{{< tab header="CSharp" text=true >}}
284249
{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/WindowsTest.cs#L45-L46" >}}
285250
{{< /tab >}}

0 commit comments

Comments
 (0)