diff --git a/examples/dotnet/SeleniumDocs/Interactions/InteractionsTest.cs b/examples/dotnet/SeleniumDocs/Interactions/InteractionsTest.cs new file mode 100644 index 000000000000..bc20acb09f08 --- /dev/null +++ b/examples/dotnet/SeleniumDocs/Interactions/InteractionsTest.cs @@ -0,0 +1,48 @@ +// Licensed to the Software Freedom Conservancy (SFC) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The SFC licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using OpenQA.Selenium; +using OpenQA.Selenium.Chrome; +namespace SeleniumDocumentation.SeleniumInteractions +{ + [TestClass] + public class InteractionsTest + { + [TestMethod] + public void TestInteractions() + { + WebDriver driver = new ChromeDriver(); + driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromMilliseconds(500); + + // Navigate to Url + driver.Url="https://www.selenium.dev/"; + //GetTitle + String title = driver.Title; + Assert.AreEqual(title, "Selenium"); + + //GetCurrentURL + String url = driver.Url; + Assert.AreEqual(url, "https://www.selenium.dev/"); + + //quitting driver + driver.Quit(); //close all windows + } + } +} \ No newline at end of file diff --git a/website_and_docs/content/documentation/webdriver/interactions/_index.en.md b/website_and_docs/content/documentation/webdriver/interactions/_index.en.md index 7cf5224f2c1b..f74e170b38fc 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/_index.en.md +++ b/website_and_docs/content/documentation/webdriver/interactions/_index.en.md @@ -23,7 +23,9 @@ You can read the current page title from the browser: {{< tab header="Python" text=true >}} {{< gh-codeblock path="examples/python/tests/interactions/test_interactions.py#L7" >}} {{< /tab >}} -{{< tab header="CSharp" >}}driver.Title;{{< /tab >}} +{{< tab header="CSharp" text=true >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/InteractionsTest.cs#L37" >}} +{{< /tab >}} {{< tab header="Ruby" text=true >}} {{< gh-codeblock path="examples/ruby/spec/interactions/browser_spec.rb#L8" >}} {{< /tab >}} @@ -46,7 +48,9 @@ You can read the current URL from the browser's address bar using: {{< tab header="Python" text=true >}} {{< gh-codeblock path="examples/python/tests/interactions/test_interactions.py#L10" >}} {{< /tab >}} -{{< tab header="CSharp" >}}driver.Url;{{< /tab >}} +{{< tab header="CSharp" text=true >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/InteractionsTest.cs#L41" >}} +{{< /tab >}} {{< tab header="Ruby" text=true >}} {{< gh-codeblock path="examples/ruby/spec/interactions/browser_spec.rb#L14" >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/interactions/_index.ja.md b/website_and_docs/content/documentation/webdriver/interactions/_index.ja.md index 8bf9e9d0908b..14afe513e041 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/_index.ja.md +++ b/website_and_docs/content/documentation/webdriver/interactions/_index.ja.md @@ -22,7 +22,9 @@ aliases: [ {{< tab header="Python" text=true >}} {{< gh-codeblock path="examples/python/tests/interactions/test_interactions.py#L7" >}} {{< /tab >}} - {{< tab header="CSharp" >}}driver.Title;{{< /tab >}} +{{< tab header="CSharp" text=true >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/InteractionsTest.cs#L37" >}} +{{< /tab >}} {{< tab header="Ruby" text=true >}} {{< gh-codeblock path="examples/ruby/spec/interactions/browser_spec.rb#L8" >}} {{< /tab >}} @@ -44,7 +46,9 @@ aliases: [ {{< tab header="Python" text=true >}} {{< gh-codeblock path="examples/python/tests/interactions/test_interactions.py#L10" >}} {{< /tab >}} -{{< tab header="CSharp" >}}driver.Url;{{< /tab >}} +{{< tab header="CSharp" text=true >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/InteractionsTest.cs#L41" >}} +{{< /tab >}} {{< tab header="Ruby" text=true >}} {{< gh-codeblock path="examples/ruby/spec/interactions/browser_spec.rb#L14" >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/interactions/_index.pt-br.md b/website_and_docs/content/documentation/webdriver/interactions/_index.pt-br.md index a62f0eb7dd37..38f3b7a21ba5 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/_index.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/interactions/_index.pt-br.md @@ -23,7 +23,9 @@ Você pode ler o título da página atual no navegador: {{< tab header="Python" text=true >}} {{< gh-codeblock path="examples/python/tests/interactions/test_interactions.py#L7" >}} {{< /tab >}} - {{< tab header="CSharp" >}}driver.Title;{{< /tab >}} +{{< tab header="CSharp" text=true >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/InteractionsTest.cs#L37" >}} +{{< /tab >}} {{< tab header="Ruby" text=true >}} {{< gh-codeblock path="examples/ruby/spec/interactions/browser_spec.rb#L8" >}} {{< /tab >}} @@ -45,7 +47,9 @@ Você pode ler a URL atual na barra de endereço do navegador usando: {{< tab header="Python" text=true >}} {{< gh-codeblock path="examples/python/tests/interactions/test_interactions.py#L10" >}} {{< /tab >}} -{{< tab header="CSharp" >}}driver.Url;{{< /tab >}} +{{< tab header="CSharp" text=true >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/InteractionsTest.cs#L41" >}} +{{< /tab >}} {{< tab header="Ruby" text=true >}} {{< gh-codeblock path="examples/ruby/spec/interactions/browser_spec.rb#L14" >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/interactions/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/interactions/_index.zh-cn.md index 6e2866f8d0a7..9e27fb70d0e8 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/_index.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/interactions/_index.zh-cn.md @@ -22,7 +22,9 @@ aliases: [ {{< tab header="Python" text=true >}} {{< gh-codeblock path="examples/python/tests/interactions/test_interactions.py#L7" >}} {{< /tab >}} -{{< tab header="CSharp" >}}driver.Title;{{< /tab >}} +{{< tab header="CSharp" text=true >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/InteractionsTest.cs#L37" >}} +{{< /tab >}} {{< tab header="Ruby" text=true >}} {{< gh-codeblock path="examples/ruby/spec/interactions/browser_spec.rb#L8" >}} {{< /tab >}} @@ -43,7 +45,9 @@ aliases: [ {{< tab header="Python" text=true >}} {{< gh-codeblock path="examples/python/tests/interactions/test_interactions.py#L10" >}} {{< /tab >}} -{{< tab header="CSharp" >}}driver.Url;{{< /tab >}} +{{< tab header="CSharp" text=true >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/InteractionsTest.cs#L41" >}} +{{< /tab >}} {{< tab header="Ruby" text=true >}} {{< gh-codeblock path="examples/ruby/spec/interactions/browser_spec.rb#L14" >}} {{< /tab >}}