Skip to content

Commit acbde0c

Browse files
committed
chore:Update readme for java [deploy site]
1 parent 728f851 commit acbde0c

File tree

5 files changed

+68
-5
lines changed

5 files changed

+68
-5
lines changed

examples/java/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Running Selenium Java Tests
2+
The following steps will guide you on how to
3+
run Selenium Java tests using a repository
4+
of `SeleniumHQ/seleniumhq.github.io` examples.
5+
6+
## Initial Setup
7+
8+
### Prerequisites
9+
10+
Ensure that Java Development Kit (JDK) and Maven
11+
are installed on your system. If they are not installed,
12+
you will need to download and install them. You can
13+
find detailed installation guides for both on their
14+
respective official sites.
15+
16+
### Clone the repository
17+
First, we need to get the Selenium Java examples
18+
on your local machine. This can be done by
19+
cloning the `SeleniumHQ/seleniumhq.github.io` Git repository.
20+
Run the following command in your terminal:
21+
22+
```bash
23+
git clone https://github.com/SeleniumHQ/seleniumhq.github.io.git
24+
```
25+
## Navigate to the java directory
26+
After cloning the repository, navigate into the
27+
directory where the Selenium Java examples are
28+
located. Run the following command:
29+
30+
```bash
31+
cd seleniumhq.github.io/examples/java
32+
```
33+
34+
## Running the Tests
35+
### Install dependencies
36+
Before running the tests, we need to install all
37+
necessary dependencies. Maven, a software
38+
project management tool, can do this for us.
39+
Run the following command:
40+
41+
```bash
42+
mvn test-compile
43+
```
44+
45+
### Run all tests
46+
To verify if everything is installed correctly and
47+
functioning properly, we should run all
48+
available tests. This can be done with the following command:
49+
50+
```bash
51+
mvn test
52+
```
53+
54+
Please be patient! If this is your first time running these tests,
55+
it might take a while to download and verify all necessary browser drivers.
56+
57+
## Execute a specific example
58+
To run a specific Selenium Java example, use the following command:
59+
```bash
60+
mvn exec:java -D"exec.mainClass"="dev.selenium.getting_started.FirstScript" -D"exec.classpathScope"=test
61+
```
62+
63+
Make sure to replace `dev.selenium.getting_started.FirstScript` with the path and name of the example you want to run.

website_and_docs/content/documentation/webdriver/getting_started/first_script.en.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Elements store a lot of [information that can be requested]({{< ref "/documentat
183183
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScript.java#L27" >}}
184184
{{< /tab >}}
185185
{{< tab header="Python" >}}
186-
{{< gh-codeblock path="examples/python/tests/getting_started/first_script.py#L19" >}}
186+
{{< gh-codeblock path="examples/python/tests/getting_started/first_script.py#L18-19" >}}
187187
{{< /tab >}}
188188
{{< tab header="CSharp" >}}
189189
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScript.cs#L26" >}}
@@ -230,7 +230,7 @@ See [Quitting Sessions]({{< ref "../drivers/#quitting-sessions" >}}).
230230

231231
{{< tabpane text=true >}}
232232
{{< tab header="Java" >}}
233-
{{< badge-code >}}
233+
{{< gh-codeblock path="examples/java/README.md#L60" >}}
234234
{{< /tab >}}
235235
{{< tab header="Python" >}}
236236
{{< badge-code >}}

website_and_docs/content/documentation/webdriver/getting_started/first_script.ja.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ See [Quitting Sessions]({{< ref "../drivers/#quitting-sessions" >}}).
233233

234234
{{< tabpane text=true >}}
235235
{{< tab header="Java" >}}
236-
{{< badge-code >}}
236+
{{< gh-codeblock path="examples/java/README.md#L60" >}}
237237
{{< /tab >}}
238238
{{< tab header="Python" >}}
239239
{{< badge-code >}}

website_and_docs/content/documentation/webdriver/getting_started/first_script.pt-br.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ See [Quitting Sessions]({{< ref "../drivers/#quitting-sessions" >}}).
232232

233233
{{< tabpane text=true >}}
234234
{{< tab header="Java" >}}
235-
{{< badge-code >}}
235+
{{< gh-codeblock path="examples/java/README.md#L60" >}}
236236
{{< /tab >}}
237237
{{< tab header="Python" >}}
238238
{{< badge-code >}}

website_and_docs/content/documentation/webdriver/getting_started/first_script.zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ Selenium所做的一切,
245245

246246
{{< tabpane text=true >}}
247247
{{< tab header="Java" >}}
248-
{{< badge-code >}}
248+
{{{< gh-codeblock path="examples/java/README.md#L60" >}}
249249
{{< /tab >}}
250250
{{< tab header="Python" >}}
251251
{{< badge-code >}}

0 commit comments

Comments
 (0)