forked from SeleniumHQ/selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dotnet] use correct devtools session id after reinitialization
Fix regression issue, appeared in v4.17. Closing a tab breaks the devtools session Fixes SeleniumHQ#13755
- Loading branch information
1 parent
911b312
commit bacefcc
Showing
2 changed files
with
40 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using NUnit.Framework; | ||
using System.Threading.Tasks; | ||
|
||
namespace OpenQA.Selenium.DevTools | ||
{ | ||
using CurrentCdpVersion = V123; | ||
|
||
[TestFixture] | ||
public class DevToolsTabsTest : DevToolsTestFixture | ||
{ | ||
|
||
[Test] | ||
[IgnoreBrowser(Selenium.Browser.IE, "IE does not support Chrome DevTools Protocol")] | ||
[IgnoreBrowser(Selenium.Browser.Firefox, "Firefox does not support Chrome DevTools Protocol")] | ||
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")] | ||
public async Task ClosingTabDoesNotBreakDevToolsSession() | ||
{ | ||
var domains = session.GetVersionSpecificDomains<CurrentCdpVersion.DevToolsSessionDomains>(); | ||
await domains.Console.Enable(); | ||
var oldWindowHandle = driver.CurrentWindowHandle; | ||
driver.SwitchTo().NewWindow(WindowType.Tab); | ||
driver.SwitchTo().Window(oldWindowHandle); | ||
driver.Close(); | ||
Assert.That( | ||
async () => { | ||
await domains.Console.Enable(); | ||
}, | ||
Throws.Nothing | ||
); | ||
} | ||
} | ||
} |