Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added command to run python script to follow first script example #1710

Open
wants to merge 11 commits into
base: trunk
Choose a base branch
from
41 changes: 41 additions & 0 deletions examples/dotnet/README.md
Original file line number Diff line number Diff line change
@@ -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
sadik312 marked this conversation as resolved.
Show resolved Hide resolved
```

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
```
48 changes: 46 additions & 2 deletions examples/java/README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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.
Make sure to replace `dev.selenium.getting_started.FirstScript` with the path and name of the example you want to run.
42 changes: 42 additions & 0 deletions examples/kotlin/README.md
Original file line number Diff line number Diff line change
@@ -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
```
11 changes: 10 additions & 1 deletion examples/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Make sure to replace `path/to/test_script.py` with the path and name of the example you want to run.
Original file line number Diff line number Diff line change
Expand Up @@ -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" >}}
Expand All @@ -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 >}}

Expand Down