From 0a6b8ad4f5011ecf3a0c3f34b034261562bc275b Mon Sep 17 00:00:00 2001 From: Nikolay Borisenko <22616990+nvborisenko@users.noreply.github.com> Date: Sun, 28 Jun 2026 18:07:42 +0300 Subject: [PATCH 1/4] [dotnet] [test] Clean driver fixture from expected page titles --- dotnet/test/webdriver/DriverTestFixture.cs | 10 -------- dotnet/test/webdriver/NavigationTests.cs | 24 +++++++++---------- dotnet/test/webdriver/SessionHandlingTests.cs | 2 +- 3 files changed, 13 insertions(+), 23 deletions(-) diff --git a/dotnet/test/webdriver/DriverTestFixture.cs b/dotnet/test/webdriver/DriverTestFixture.cs index 2437dba2c81cd..8f312c42bee2e 100644 --- a/dotnet/test/webdriver/DriverTestFixture.cs +++ b/dotnet/test/webdriver/DriverTestFixture.cs @@ -27,16 +27,6 @@ public abstract class DriverTestFixture { protected static UrlBuilder Urls => EnvironmentManager.Instance.WebServer.Urls; - public string macbethTitle = "Macbeth: Entire Play"; - - public string simpleTestTitle = "Hello WebDriver"; - - public string framesTitle = "This page has frames"; - - public string iframesTitle = "This page has iframes"; - - public string formsTitle = "We Leave From Here"; - public IWebDriver driver { get; set; } public bool IsNativeEventsEnabled diff --git a/dotnet/test/webdriver/NavigationTests.cs b/dotnet/test/webdriver/NavigationTests.cs index b4c30ab56f9a3..0640cf999b08a 100644 --- a/dotnet/test/webdriver/NavigationTests.cs +++ b/dotnet/test/webdriver/NavigationTests.cs @@ -43,10 +43,10 @@ public void ShouldGoBackAndForward() driver.Url = Urls.SimpleTestPage; navigation.Back(); - Assert.That(driver.Title, Is.EqualTo(macbethTitle)); + Assert.That(driver.Title, Is.EqualTo("Macbeth: Entire Play")); navigation.Forward(); - Assert.That(driver.Title, Is.EqualTo(simpleTestTitle)); + Assert.That(driver.Title, Is.EqualTo("Hello WebDriver")); } [Test] @@ -66,12 +66,12 @@ public void ShouldGoToUrlUsingString() navigation = driver.Navigate(); navigation.GoToUrl(Urls.MacbethPage); - Assert.That(driver.Title, Is.EqualTo(macbethTitle)); + Assert.That(driver.Title, Is.EqualTo("Macbeth: Entire Play")); // We go to two pages to ensure that the browser wasn't // already at the desired page through a previous test. navigation.GoToUrl(Urls.SimpleTestPage); - Assert.That(driver.Title, Is.EqualTo(simpleTestTitle)); + Assert.That(driver.Title, Is.EqualTo("Hello WebDriver")); } [Test] @@ -83,12 +83,12 @@ public void ShouldGoToUrlUsingUri() navigation = driver.Navigate(); navigation.GoToUrl(macBeth); - Assert.That(macbethTitle, Is.EqualTo(driver.Title)); + Assert.That("Macbeth: Entire Play", Is.EqualTo(driver.Title)); // We go to two pages to ensure that the browser wasn't // already at the desired page through a previous test. navigation.GoToUrl(simpleTest); - Assert.That(driver.Title, Is.EqualTo(simpleTestTitle)); + Assert.That(driver.Title, Is.EqualTo("Hello WebDriver")); } [Test] @@ -123,10 +123,10 @@ public async Task ShouldGoBackAndForwardAsync() await navigation.GoToUrlAsync(Urls.SimpleTestPage); await navigation.BackAsync(); - Assert.That(driver.Title, Is.EqualTo(macbethTitle)); + Assert.That(driver.Title, Is.EqualTo("Macbeth: Entire Play")); await navigation.ForwardAsync(); - Assert.That(driver.Title, Is.EqualTo(simpleTestTitle)); + Assert.That(driver.Title, Is.EqualTo("Hello WebDriver")); } [Test] @@ -142,10 +142,10 @@ public async Task ShouldGoToUrlUsingStringAsync() var navigation = driver.Navigate(); await navigation.GoToUrlAsync(Urls.MacbethPage); - Assert.That(driver.Title, Is.EqualTo(macbethTitle)); + Assert.That(driver.Title, Is.EqualTo("Macbeth: Entire Play")); await navigation.GoToUrlAsync(Urls.SimpleTestPage); - Assert.That(driver.Title, Is.EqualTo(simpleTestTitle)); + Assert.That(driver.Title, Is.EqualTo("Hello WebDriver")); } [Test] @@ -154,9 +154,9 @@ public void ShouldGoToUrlUsingUriAsync() var navigation = driver.Navigate(); navigation.GoToUrlAsync(new Uri(Urls.MacbethPage)); - Assert.That(macbethTitle, Is.EqualTo(driver.Title)); + Assert.That("Macbeth: Entire Play", Is.EqualTo(driver.Title)); navigation.GoToUrl(new Uri(Urls.SimpleTestPage)); - Assert.That(driver.Title, Is.EqualTo(simpleTestTitle)); + Assert.That(driver.Title, Is.EqualTo("Hello WebDriver")); } [Test] diff --git a/dotnet/test/webdriver/SessionHandlingTests.cs b/dotnet/test/webdriver/SessionHandlingTests.cs index e98804de4fca6..7e1e625cfa8af 100644 --- a/dotnet/test/webdriver/SessionHandlingTests.cs +++ b/dotnet/test/webdriver/SessionHandlingTests.cs @@ -153,7 +153,7 @@ public void ShouldOpenAndCloseBrowserRepeatedly() EnvironmentManager.Instance.CloseCurrentDriver(); CreateFreshDriver(); driver.Url = Urls.SimpleTestPage; - Assert.That(driver.Title, Is.EqualTo(simpleTestTitle)); + Assert.That(driver.Title, Is.EqualTo("Hello WebDriver")); } } } From ffbcfe0563e8a089c811ca786081738abcd24dae Mon Sep 17 00:00:00 2001 From: Nikolay Borisenko <22616990+nvborisenko@users.noreply.github.com> Date: Sun, 28 Jun 2026 18:41:51 +0300 Subject: [PATCH 2/4] Swap 157 --- dotnet/test/webdriver/NavigationTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotnet/test/webdriver/NavigationTests.cs b/dotnet/test/webdriver/NavigationTests.cs index 0640cf999b08a..500818aba338e 100644 --- a/dotnet/test/webdriver/NavigationTests.cs +++ b/dotnet/test/webdriver/NavigationTests.cs @@ -154,7 +154,7 @@ public void ShouldGoToUrlUsingUriAsync() var navigation = driver.Navigate(); navigation.GoToUrlAsync(new Uri(Urls.MacbethPage)); - Assert.That("Macbeth: Entire Play", Is.EqualTo(driver.Title)); + Assert.That(driver.Title, Is.EqualTo("Macbeth: Entire Play")); navigation.GoToUrl(new Uri(Urls.SimpleTestPage)); Assert.That(driver.Title, Is.EqualTo("Hello WebDriver")); } From 7c782439dd6a02057a50aa6fb4b15eafd6eb58d1 Mon Sep 17 00:00:00 2001 From: Nikolay Borisenko <22616990+nvborisenko@users.noreply.github.com> Date: Sun, 28 Jun 2026 18:54:17 +0300 Subject: [PATCH 3/4] Merge --- dotnet/test/webdriver/DriverTestFixture.cs | 10 -------- dotnet/test/webdriver/NavigationTests.cs | 24 +++++++++---------- dotnet/test/webdriver/SessionHandlingTests.cs | 2 +- 3 files changed, 13 insertions(+), 23 deletions(-) diff --git a/dotnet/test/webdriver/DriverTestFixture.cs b/dotnet/test/webdriver/DriverTestFixture.cs index 9829166b9fe17..3ec0fa411c7c8 100644 --- a/dotnet/test/webdriver/DriverTestFixture.cs +++ b/dotnet/test/webdriver/DriverTestFixture.cs @@ -27,16 +27,6 @@ public abstract class DriverTestFixture { protected static UrlBuilder Urls => EnvironmentManager.Instance.WebServer.Urls; - public string macbethTitle = "Macbeth: Entire Play"; - - public string simpleTestTitle = "Hello WebDriver"; - - public string framesTitle = "This page has frames"; - - public string iframesTitle = "This page has iframes"; - - public string formsTitle = "We Leave From Here"; - protected internal IWebDriver Driver { get; set; } public bool IsNativeEventsEnabled diff --git a/dotnet/test/webdriver/NavigationTests.cs b/dotnet/test/webdriver/NavigationTests.cs index cbd35305b91f3..3e482855dcf5a 100644 --- a/dotnet/test/webdriver/NavigationTests.cs +++ b/dotnet/test/webdriver/NavigationTests.cs @@ -43,10 +43,10 @@ public void ShouldGoBackAndForward() Driver.Url = Urls.SimpleTestPage; navigation.Back(); - Assert.That(Driver.Title, Is.EqualTo(macbethTitle)); + Assert.That(Driver.Title, Is.EqualTo("Macbeth: Entire Play")); navigation.Forward(); - Assert.That(Driver.Title, Is.EqualTo(simpleTestTitle)); + Assert.That(Driver.Title, Is.EqualTo("Hello WebDriver")); } [Test] @@ -66,12 +66,12 @@ public void ShouldGoToUrlUsingString() navigation = Driver.Navigate(); navigation.GoToUrl(Urls.MacbethPage); - Assert.That(Driver.Title, Is.EqualTo(macbethTitle)); + Assert.That(Driver.Title, Is.EqualTo("Macbeth: Entire Play")); // We go to two pages to ensure that the browser wasn't // already at the desired page through a previous test. navigation.GoToUrl(Urls.SimpleTestPage); - Assert.That(Driver.Title, Is.EqualTo(simpleTestTitle)); + Assert.That(Driver.Title, Is.EqualTo("Hello WebDriver")); } [Test] @@ -83,12 +83,12 @@ public void ShouldGoToUrlUsingUri() navigation = Driver.Navigate(); navigation.GoToUrl(macBeth); - Assert.That(macbethTitle, Is.EqualTo(Driver.Title)); + Assert.That(Driver.Title, Is.EqualTo("Macbeth: Entire Play")); // We go to two pages to ensure that the browser wasn't // already at the desired page through a previous test. navigation.GoToUrl(simpleTest); - Assert.That(Driver.Title, Is.EqualTo(simpleTestTitle)); + Assert.That(Driver.Title, Is.EqualTo("Hello WebDriver")); } [Test] @@ -123,10 +123,10 @@ public async Task ShouldGoBackAndForwardAsync() await navigation.GoToUrlAsync(Urls.SimpleTestPage); await navigation.BackAsync(); - Assert.That(Driver.Title, Is.EqualTo(macbethTitle)); + Assert.That(Driver.Title, Is.EqualTo("Macbeth: Entire Play")); await navigation.ForwardAsync(); - Assert.That(Driver.Title, Is.EqualTo(simpleTestTitle)); + Assert.That(Driver.Title, Is.EqualTo("Hello WebDriver")); } [Test] @@ -142,10 +142,10 @@ public async Task ShouldGoToUrlUsingStringAsync() var navigation = Driver.Navigate(); await navigation.GoToUrlAsync(Urls.MacbethPage); - Assert.That(Driver.Title, Is.EqualTo(macbethTitle)); + Assert.That(Driver.Title, Is.EqualTo("Macbeth: Entire Play")); await navigation.GoToUrlAsync(Urls.SimpleTestPage); - Assert.That(Driver.Title, Is.EqualTo(simpleTestTitle)); + Assert.That(Driver.Title, Is.EqualTo("Hello WebDriver")); } [Test] @@ -154,9 +154,9 @@ public void ShouldGoToUrlUsingUriAsync() var navigation = Driver.Navigate(); navigation.GoToUrlAsync(new Uri(Urls.MacbethPage)); - Assert.That(macbethTitle, Is.EqualTo(Driver.Title)); + Assert.That("Macbeth: Entire Play", Is.EqualTo(Driver.Title)); navigation.GoToUrl(new Uri(Urls.SimpleTestPage)); - Assert.That(Driver.Title, Is.EqualTo(simpleTestTitle)); + Assert.That(Driver.Title, Is.EqualTo("Hello WebDriver")); } [Test] diff --git a/dotnet/test/webdriver/SessionHandlingTests.cs b/dotnet/test/webdriver/SessionHandlingTests.cs index 772d8b284bc9c..db66831979072 100644 --- a/dotnet/test/webdriver/SessionHandlingTests.cs +++ b/dotnet/test/webdriver/SessionHandlingTests.cs @@ -153,7 +153,7 @@ public void ShouldOpenAndCloseBrowserRepeatedly() EnvironmentManager.Instance.CloseCurrentDriver(); CreateFreshDriver(); Driver.Url = Urls.SimpleTestPage; - Assert.That(Driver.Title, Is.EqualTo(simpleTestTitle)); + Assert.That(Driver.Title, Is.EqualTo("Hello WebDriver")); } } } From d700b80d0ecacfe3cd1d389985a5936c88f63277 Mon Sep 17 00:00:00 2001 From: Nikolay Borisenko <22616990+nvborisenko@users.noreply.github.com> Date: Sun, 28 Jun 2026 18:54:53 +0300 Subject: [PATCH 4/4] Fix warn --- dotnet/test/webdriver/NavigationTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotnet/test/webdriver/NavigationTests.cs b/dotnet/test/webdriver/NavigationTests.cs index 3e482855dcf5a..d63746cdf4e94 100644 --- a/dotnet/test/webdriver/NavigationTests.cs +++ b/dotnet/test/webdriver/NavigationTests.cs @@ -154,7 +154,7 @@ public void ShouldGoToUrlUsingUriAsync() var navigation = Driver.Navigate(); navigation.GoToUrlAsync(new Uri(Urls.MacbethPage)); - Assert.That("Macbeth: Entire Play", Is.EqualTo(Driver.Title)); + Assert.That(Driver.Title, Is.EqualTo("Macbeth: Entire Play")); navigation.GoToUrl(new Uri(Urls.SimpleTestPage)); Assert.That(Driver.Title, Is.EqualTo("Hello WebDriver")); }