diff --git a/examples/dotnet/README.md b/examples/dotnet/README.md new file mode 100644 index 00000000000..98967cc6b14 --- /dev/null +++ b/examples/dotnet/README.md @@ -0,0 +1,41 @@ +# Running all test from Selenium C# example + +Prerequisite: Install .NET +- This link covers all cross-platform installation steps + +https://learn.microsoft.com/en-us/dotnet/core/install/ + +Follow these steps to run all test examples from selenium C# + +1. Clone this repository + +``` +git clone https://github.com/SeleniumHQ/seleniumhq.github.io.git +``` + +2. Navigate to `dotnet` directory + +``` +cd seleniumhq.github.io/examples/dotnet +``` + +3. Install dependecies using dotnet + +``` +dotnet restore +``` + +4. Run all tests +> Open the terminal or command prompt and navigate to the directory where your test project's .csproj file is located and run the following command in the terminal + +``` +dotnet test +``` + +# Execute a C# script + +Use this command to run a C# script and follow the first script example + +``` +dotnet run HelloSelenium.cs +``` \ No newline at end of file diff --git a/examples/java/README.md b/examples/java/README.md index ebe2468de5a..b7193ec2aff 100644 --- a/examples/java/README.md +++ b/examples/java/README.md @@ -1,4 +1,48 @@ -# Running Selenium Java Tests +# Running all tests from Selenium java example using gradle + +Follow these steps to run all test examples from selenium java + +1. Clone this repository + +``` +git clone https://github.com/SeleniumHQ/seleniumhq.github.io.git +``` + +2. Navigate to `java` directory + +``` +cd seleniumhq.github.io/examples/java +``` + +3. Install & build dependencies using grandlew + +``` +gradle build +``` + +4. Run all tests + +``` +gradle test +``` + +# Compile a java file + +Use this command to compile a java script and follow the first script example + +``` +javac FirstScript.js +``` + +# Execute a java file + +Use this command to run a java file + +``` +java FirstScript +``` + +# Running Selenium Java Tests Using Maven The following steps will guide you on how to run Selenium Java tests using a repository of `SeleniumHQ/seleniumhq.github.io` examples. @@ -60,4 +104,4 @@ To run a specific Selenium Java example, use the following command: mvn exec:java -D"exec.mainClass"="dev.selenium.getting_started.FirstScript" -D"exec.classpathScope"=test ``` -Make sure to replace `dev.selenium.getting_started.FirstScript` with the path and name of the example you want to run. \ No newline at end of file +Make sure to replace `dev.selenium.getting_started.FirstScript` with the path and name of the example you want to run. diff --git a/examples/kotlin/README.md b/examples/kotlin/README.md new file mode 100644 index 00000000000..287c72eaf06 --- /dev/null +++ b/examples/kotlin/README.md @@ -0,0 +1,42 @@ +# Running all tests from Selenium kotlin example + +Follow these steps to run all test examples from selenium kotlin + +1. Clone this repository + +``` +git clone https://github.com/SeleniumHQ/seleniumhq.github.io.git +``` + +2. Navigate to `kotlin` directory + +``` +cd seleniumhq.github.io/examples/kotlin +``` + +3. Install dependencies (using maven) + +``` +mvn clean install +``` + +4. Run all tests + +``` +mvn test +``` +> or to run all tests in a specific class you can run `mvn -Dtest=classname test` + +# Compile kotlin script and follow the first script example + +Compile kotlin file +``` +kotlinc FirstScriptTest.kt -include-runtime -d FirstScriptTest.jar +``` + +# Execute a kotlin script + +Execute +``` +java -jar FirstScriptTest.jar +``` \ No newline at end of file diff --git a/examples/python/README.md b/examples/python/README.md index 2db5f25cb9a..06f93ee6c90 100644 --- a/examples/python/README.md +++ b/examples/python/README.md @@ -29,10 +29,19 @@ pytest > Please keep some patience - If you are doing it for the first time, it will take a little while to verify and download the browser drivers + +# Execute a python script + +Use this command to run a python script and follow the first script example + +``` +python example_script.py +``` +======= ## Execute a specific example To run a specific Selenium Python example, use the following command: ```bash pytest path/to/test_script.py ``` -Make sure to replace `path/to/test_script.py` with the path and name of the example you want to run. \ No newline at end of file +Make sure to replace `path/to/test_script.py` with the path and name of the example you want to run. diff --git a/website_and_docs/content/documentation/webdriver/getting_started/first_script.en.md b/website_and_docs/content/documentation/webdriver/getting_started/first_script.en.md index 79215729457..140aa3aeb13 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/first_script.en.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/first_script.en.md @@ -233,10 +233,11 @@ See [Quitting Sessions]({{< ref "../drivers/#quitting-sessions" >}}). {{< gh-codeblock path="examples/java/README.md#L60" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/README.md#L35" >}} +{{< gh-codeblock path="examples/python/README.md#L37" >}} + {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/README.md#L35" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/README.md#L36" >}} @@ -245,7 +246,8 @@ See [Quitting Sessions]({{< ref "../drivers/#quitting-sessions" >}}). {{< gh-codeblock path="examples/javascript/README.md#L36" >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/kotlin/README.md#L32-36 >}} +{{< gh-codeblock path="examples/kotlin/README.md#L39-42 >}} {{< /tab >}} {{< /tabpane >}}