Skip to content

Commit 4e8e129

Browse files
dckidiemol
andauthored
Describe testing beforeunload in alerts.en.md (#2266)
* Describe testing beforeunload in alerts.en.md Related info for ChromeDriver: https://issues.chromium.org/issues/351858989#comment30 * Document beforeunload prompt behavior with unhandledPromptBehavior Cross-reference the beforeunload/BiDi/ChromeDriver caveat from the alerts docs to the unhandledPromptBehavior section in options docs, where the capability is already documented per language, instead of duplicating binding-specific syntax inline. Added in all four languages. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Wrap translated beforeunload notes to ~100 char lines Qodo flagged the new ja/pt-br/zh-cn notes as single unwrapped lines (up to 209 chars), violating the line-length rule in the style guide. Wrap using semantic linefeeds; rendered output is unchanged since Markdown collapses the soft line breaks to a single space. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Diego Molina <diemol@users.noreply.github.com> [deploy site]
1 parent 3fe51a6 commit 4e8e129

8 files changed

Lines changed: 36 additions & 0 deletions

File tree

website_and_docs/content/documentation/webdriver/drivers/options.en.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,9 @@ user prompt encounters at the remote-end. This is defined by
425425
{{< /tab >}}
426426
{{< /tabpane >}}
427427

428+
NOTE: For `beforeunload` prompts specifically, ChromeDriver needs `ignore` set in addition to
429+
[BiDi]({{< ref "../bidi/" >}}) enabled to keep the prompt open.
430+
428431
## setWindowRect
429432

430433
Indicates whether the remote end supports all of the [resizing and repositioning](https://w3c.github.io/webdriver/#resizing-and-positioning-windows) [commands](https://w3c.github.io/webdriver/#dfn-commands).

website_and_docs/content/documentation/webdriver/drivers/options.ja.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,10 @@ WebDriverの `セッション` には特定の `セッションタイムアウ
402402
{{< /tab >}}
403403
{{< /tabpane >}}
404404

405+
注:`beforeunload` プロンプトに関しては、
406+
プロンプトを開いたままにするために、[BiDi]({{< ref "../bidi/" >}}) を有効にすることに加えて、
407+
ChromeDriver で `ignore` を設定する必要があります。
408+
405409
## setWindowRect
406410

407411
リモート エンドがすべての [サイズ変更および再配置](https://w3c.github.io/webdriver/#resizing-and-positioning-windows)

website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,9 @@ user prompt encounters at the remote-end. This is defined by
437437
{{< /tab >}}
438438
{{< /tabpane >}}
439439

440+
Nota: Para prompts de `beforeunload` especificamente,
441+
o ChromeDriver precisa que `ignore` seja definido além de ter o
442+
[BiDi]({{< ref "../bidi/" >}}) habilitado para manter o prompt aberto.
440443

441444
## setWindowRect
442445

website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,9 @@ WebDriver创建新会话时,
427427
{{< /tab >}}
428428
{{< /tabpane >}}
429429

430+
注意:对于 `beforeunload` 提示框,
431+
除了启用 [BiDi]({{< ref "../bidi/" >}}) 外,
432+
ChromeDriver 还需要设置 `ignore` 才能保持提示框打开。
430433

431434
## setWindowRect
432435

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,8 @@ alert.sendKeys("Selenium")
176176
alert.accept()
177177
{{< /tab >}}
178178
{{< /tabpane >}}
179+
180+
## beforeunload
181+
182+
Recent drivers automatically dismiss `beforeunload` prompts by default. To keep the old behavior,
183+
see [unhandledPromptBehavior]({{< ref "../drivers/options#unhandledpromptbehavior" >}}).

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,3 +169,9 @@ alert.sendKeys("Selenium")
169169
alert.accept()
170170
{{< /tab >}}
171171
{{< /tabpane >}}
172+
173+
## beforeunload
174+
175+
最近のドライバーでは、デフォルトで `beforeunload` プロンプトを自動的に閉じます。
176+
以前の動作を維持するには、
177+
[unhandledPromptBehavior]({{< ref "../drivers/options#unhandledpromptbehavior" >}}) を参照してください。

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,9 @@ alert.sendKeys("Selenium")
162162
alert.accept()
163163
{{< /tab >}}
164164
{{< /tabpane >}}
165+
166+
## beforeunload
167+
168+
Drivers recentes descartam automaticamente os prompts de `beforeunload` por padrão.
169+
Para manter o comportamento antigo,
170+
veja [unhandledPromptBehavior]({{< ref "../drivers/options#unhandledpromptbehavior" >}}).

website_and_docs/content/documentation/webdriver/interactions/alerts.zh-cn.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,9 @@ alert.sendKeys("Selenium")
164164
alert.accept()
165165
{{< /tab >}}
166166
{{< /tabpane >}}
167+
168+
## beforeunload
169+
170+
较新版本的驱动默认会自动关闭 `beforeunload` 提示框。
171+
如果需要恢复旧的行为,
172+
请参阅 [unhandledPromptBehavior]({{< ref "../drivers/options#unhandledpromptbehavior" >}})。

0 commit comments

Comments
 (0)