From 2c7aeb67a4881f4171defd4d7ed7764329bc7fd7 Mon Sep 17 00:00:00 2001 From: Sadik Islam Date: Tue, 7 May 2024 13:56:17 +0100 Subject: [PATCH 1/3] added command to run python script to follow first script example --- examples/python/README.md | 8 ++++++++ .../webdriver/getting_started/first_script.en.md | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/examples/python/README.md b/examples/python/README.md index db8a216be661..5fb1ef5ff62f 100644 --- a/examples/python/README.md +++ b/examples/python/README.md @@ -28,3 +28,11 @@ 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 +``` \ No newline at end of file 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 b7124efb122d..8fd1736508a5 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,7 +233,7 @@ See [Quitting Sessions]({{< ref "../drivers/#quitting-sessions" >}}). {{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/README.md#L37" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} From 671371d09510b26c3a66f1be7ce2fab34274d955 Mon Sep 17 00:00:00 2001 From: Sadik Islam Date: Thu, 9 May 2024 16:06:56 +0100 Subject: [PATCH 2/3] added execution commands for all languages to follow script example --- examples/dotnet/README.md | 36 ++++++++++++++++ examples/java/README.md | 43 +++++++++++++++++++ examples/kotlin/README.md | 42 ++++++++++++++++++ .../getting_started/first_script.en.md | 5 ++- 4 files changed, 124 insertions(+), 2 deletions(-) create mode 100644 examples/dotnet/README.md create mode 100644 examples/java/README.md create mode 100644 examples/kotlin/README.md diff --git a/examples/dotnet/README.md b/examples/dotnet/README.md new file mode 100644 index 000000000000..7530644d378c --- /dev/null +++ b/examples/dotnet/README.md @@ -0,0 +1,36 @@ +# Running all test from Selenium C# example + +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 new file mode 100644 index 000000000000..9f5cd6ff5522 --- /dev/null +++ b/examples/java/README.md @@ -0,0 +1,43 @@ +# Running all tests from Selenium java example + +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 +``` \ No newline at end of file diff --git a/examples/kotlin/README.md b/examples/kotlin/README.md new file mode 100644 index 000000000000..287c72eaf069 --- /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/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 8fd1736508a5..854748218af8 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 @@ -236,7 +236,7 @@ See [Quitting Sessions]({{< ref "../drivers/#quitting-sessions" >}}). {{< 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 +245,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 >}} From 98e26c10c03776dadb8e63d19804af8618fdd73a Mon Sep 17 00:00:00 2001 From: Sadik Date: Fri, 8 Nov 2024 22:03:15 +0000 Subject: [PATCH 3/3] added microsoft .NET cross-platform installation link --- examples/dotnet/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/dotnet/README.md b/examples/dotnet/README.md index 7530644d378c..98967cc6b148 100644 --- a/examples/dotnet/README.md +++ b/examples/dotnet/README.md @@ -1,5 +1,10 @@ # 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