diff --git a/examples/java/README.md b/examples/java/README.md new file mode 100644 index 000000000000..4208dc97d16c --- /dev/null +++ b/examples/java/README.md @@ -0,0 +1,38 @@ +# Running all tests from Selenium Java example + +Follow these steps to run all test example 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 dependencies using maven +Ensure that JDK and Maven is installed on the system. + +``` +mvn test-compile +``` + +4. Run all tests + +``` +mvn test +``` + +> 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 first Java example + +Use this command to run first Java Example + +``` +mvn exec:java -D"exec.mainClass"="dev.selenium.getting_started.FirstScript" -D"exec.classpathScope"=test +``` \ 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..4334e581acd7 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 @@ -230,7 +230,7 @@ See [Quitting Sessions]({{< ref "../drivers/#quitting-sessions" >}}). {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/README.md#L37" >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}}