You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add example for asserting with java on getting_started/using_selenium (#1672)
* Add example for asserting with java on page getting_started/using_selenium/
Example for Asserting added for java language, by creating AssertionsTest.java
file and adding relevant code lines reference in the markdown file.
* Documentation updated for using_selenium.ja.md
* Add example of Setting up and Tear down with java
Example for Setting up and Tearing down added
for java language, by creating SetupAndTeardownTest.java
file, and adding relevant code lines reference in the markdown file(s).
* Assertion and Setup/Teardown examples linked
Assertion and Setup/Teardown examples linked with
existing UsingSeleniumTest.java, removed AssertionsTest.java
and SetupAndTeardownTest.java
* Do the requested changes
1. BeforeAll and AfterAll functions removed.
2. Print statements removed.
3. driver.manage().window().maximize() removed.
4. Driver navigation and implicit wait code moved into test body.
5. Markdown changes done in all the 4 languages.
[deploy site]
Copy file name to clipboardExpand all lines: website_and_docs/content/documentation/webdriver/getting_started/using_selenium.en.md
+35-17
Original file line number
Diff line number
Diff line change
@@ -3,20 +3,20 @@ title: "Organizing and Executing Selenium Code"
3
3
linkTitle: "Using Selenium"
4
4
weight: 10
5
5
description: >
6
-
Scaling Selenium execution with an IDE and a Test Runner library
6
+
Scaling Selenium execution with an IDE and a Test Runner library
7
7
---
8
8
9
9
{{< alert-content >}}
10
10
This page is very incomplete and has placeholders for things that need to be added or expounded on.
11
11
{{< /alert-content >}}
12
12
13
-
If you want to run more than a handful of one-off scripts, you need to
13
+
If you want to run more than a handful of one-off scripts, you need to
14
14
be able to organize and work with your code. This page should give you
15
15
ideas for how to actually do productive things with your Selenium code.
16
16
17
17
## Common Uses
18
18
19
-
Most people use Selenium to execute automated tests for web applications,
19
+
Most people use Selenium to execute automated tests for web applications,
20
20
but Selenium supports any use case of browser automation.
21
21
22
22
### Repetitive Tasks
@@ -36,10 +36,9 @@ Running Selenium for testing requires making assertions on actions taken by Sele
36
36
So a good assertion library is required. Additional features to provide structure for tests
37
37
require use of [Test Runner](#test-runners).
38
38
39
-
40
39
## IDEs
41
40
42
-
Regardless of how you use Selenium code,
41
+
Regardless of how you use Selenium code,
43
42
you won't be very effective writing or executing it without a good
44
43
Integrated Developer Environment. Here are some common options...
45
44
@@ -54,10 +53,11 @@ Integrated Developer Environment. Here are some common options...
54
53
## Test Runner
55
54
56
55
Even if you aren't using Selenium for testing, if you have advanced use cases, it might make
57
-
sense to use a test runner to better organize your code. Being able to use before/after hooks
56
+
sense to use a test runner to better organize your code. Being able to use before/after hooks
58
57
and run things in groups or in parallel can be very useful.
59
58
60
59
### Choosing
60
+
61
61
There are many different test runners available.
62
62
63
63
All the code examples in this documentation can be found in (or is being moved to) our
@@ -67,36 +67,40 @@ that will be used for all examples on this page.
67
67
68
68
{{< tabpane text=true >}}
69
69
{{% tab header="Java" %}}
70
+
70
71
-[JUnit](https://junit.org/junit5/) - A widely-used testing framework for Java-based Selenium tests.
71
72
-[TestNG](https://testng.org/) - Offers extra features like parallel test execution and parameterized tests.
72
-
{{% /tab %}}
73
+
{{% /tab %}}
73
74
74
75
{{% tab header="Python" %}}
76
+
75
77
-[pytest](https://pytest.org/) - A preferred choice for many, thanks to its simplicity and powerful plugins.
76
78
-[unittest](https://docs.python.org/3/library/unittest.html) - Python's standard library testing framework.
77
-
{{% /tab %}}
79
+
{{% /tab %}}
78
80
79
81
{{% tab header="CSharp" %}}
82
+
80
83
-[NUnit](https://nunit.org/) - A popular unit-testing framework for .NET.
81
84
-[MS Test](https://docs.microsoft.com/en-us/visualstudio/test/getting-started-with-unit-testing?view=vs-2019) - Microsoft's own unit testing framework.
82
-
{{% /tab %}}
85
+
{{% /tab %}}
83
86
84
87
{{% tab header="Ruby" %}}
88
+
85
89
-[RSpec](https://rspec.info/) - The most widely used testing library for running Selenium tests in Ruby.
86
90
-[Minitest](https://github.com/seattlerb/minitest) - A lightweight testing framework that comes with Ruby standard library.
87
-
{{% /tab %}}
91
+
{{% /tab %}}
88
92
89
93
{{% tab header="JavaScript" %}}
94
+
90
95
-[Jest](https://jestjs.io/) - Primarily known as a testing framework for React, it can also be used for Selenium tests.
91
96
-[Mocha](https://mochajs.org/) - The most common JS library for running Selenium tests.
92
-
{{% /tab %}}
97
+
{{% /tab %}}
93
98
94
99
{{% tab header="Kotlin" %}}
95
100
96
101
{{% /tab %}}
97
102
{{< /tabpane >}}
98
103
99
-
100
104
### Installing
101
105
102
106
This is very similar to what was required in [Install a Selenium Library]({{< ref "install_library.md" >}}).
@@ -136,7 +140,7 @@ In your project's `package.json`, add requirement to `dependencies`:
0 commit comments