Skip to content

Commit 9f9d814

Browse files
Documentation updated for using_selenium.ja.md
1 parent 1fd0033 commit 9f9d814

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

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

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ title: "Organizing and Executing Selenium Code"
33
linkTitle: "Using Selenium"
44
weight: 10
55
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
77
---
88

9-
If you want to run more than a handful of one-off scripts, you need to
9+
If you want to run more than a handful of one-off scripts, you need to
1010
be able to organize and work with your code. This page should give you
1111
ideas for how to actually do productive things with your Selenium code.
1212

1313
## Common Uses
1414

15-
Most people use Selenium to execute automated tests for web applications,
15+
Most people use Selenium to execute automated tests for web applications,
1616
but Selenium support any use case of browser automation.
1717

1818
### Repetitive Tasks
@@ -32,10 +32,9 @@ Running Selenium for testing requires making assertions on actions taken by Sele
3232
So a good assertion library is required. Additional features to provide structure for tests
3333
require use of [Test Runner](#test-runners).
3434

35-
3635
## IDEs
3736

38-
Regardless of how you use Selenium code,
37+
Regardless of how you use Selenium code,
3938
you won't be very effective writing or executing it without a good
4039
Integrated Developer Environment. Here are some common options...
4140

@@ -50,10 +49,11 @@ Integrated Developer Environment. Here are some common options...
5049
## Test Runner
5150

5251
Even if you aren't using Selenium for testing, if you have advanced use cases, it might make
53-
sense to use a test runner to better organize your code. Being able to use before/after hooks
52+
sense to use a test runner to better organize your code. Being able to use before/after hooks
5453
and run things in groups or in parallel can be very useful.
5554

5655
### Choosing
56+
5757
There are many different test runners available.
5858

5959
All the code examples in this documentation can be found in (or is being moved to) our
@@ -63,36 +63,40 @@ that will be used for all examples on this page.
6363

6464
{{< tabpane text=true >}}
6565
{{% tab header="Java" %}}
66+
6667
- [JUnit](https://junit.org/junit5/) - A widely-used testing framework for Java-based Selenium tests.
6768
- [TestNG](https://testng.org/) - Offers extra features like parallel test execution and parameterized tests.
68-
{{% /tab %}}
69+
{{% /tab %}}
6970

7071
{{% tab header="Python" %}}
72+
7173
- [pytest](https://pytest.org/) - A preferred choice for many, thanks to its simplicity and powerful plugins.
7274
- [unittest](https://docs.python.org/3/library/unittest.html) - Python's standard library testing framework.
73-
{{% /tab %}}
75+
{{% /tab %}}
7476

7577
{{% tab header="CSharp" %}}
78+
7679
- [NUnit](https://nunit.org/) - A popular unit-testing framework for .NET.
7780
- [MS Test](https://docs.microsoft.com/en-us/visualstudio/test/getting-started-with-unit-testing?view=vs-2019) - Microsoft's own unit testing framework.
78-
{{% /tab %}}
81+
{{% /tab %}}
7982

8083
{{% tab header="Ruby" %}}
84+
8185
- [RSpec](https://rspec.info/) - The most widely used testing library for running Selenium tests in Ruby.
8286
- [Minitest](https://github.com/seattlerb/minitest) - A lightweight testing framework that comes with Ruby standard library.
83-
{{% /tab %}}
87+
{{% /tab %}}
8488

8589
{{% tab header="JavaScript" %}}
90+
8691
- [Jest](https://jestjs.io/) - Primarily known as a testing framework for React, it can also be used for Selenium tests.
8792
- [Mocha](https://mochajs.org/) - The most common JS library for running Selenium tests.
88-
{{% /tab %}}
93+
{{% /tab %}}
8994

9095
{{% tab header="Kotlin" %}}
9196

9297
{{% /tab %}}
9398
{{< /tabpane >}}
9499

95-
96100
### Installing
97101

98102
This is very similar to what was required in [Install a Selenium Library]({{< ref "install_library.md" >}}).
@@ -130,9 +134,12 @@ In your project's `package.json`, add requirement to `dependencies`:
130134

131135
### Asserting
132136

137+
Assertions are very important part of Selenium, as they determine whether the state
138+
of the application is same what we are expecting or not. If the assertion fails,
139+
then the test case is failed and execution is stopped.
133140
{{< tabpane text=true >}}
134141
{{< tab header="Java" >}}
135-
{{< badge-code >}}
142+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/AssertionsTest.java#L20-L29" >}}
136143
{{< /tab >}}
137144
{{% tab header="Python" %}}
138145
{{< badge-code >}}
@@ -164,10 +171,13 @@ In your project's `package.json`, add requirement to `dependencies`:
164171
{{< badge-code >}}
165172
{{< /tab >}}
166173
{{% tab header="Ruby" %}}
174+
167175
### Set Up
176+
168177
{{< gh-codeblock path="examples/ruby/spec/getting_started/using_selenium_spec.rb#L7-L9" >}}
169178

170179
### Tear Down
180+
171181
{{< gh-codeblock path="examples/ruby/spec/spec_helper.rb#L28" >}}
172182
{{% /tab %}}
173183
{{< tab header="JavaScript" >}}
@@ -182,6 +192,7 @@ In your project's `package.json`, add requirement to `dependencies`:
182192

183193
{{< tabpane text=true >}}
184194
{{% tab header="Java" %}}
195+
185196
### Maven
186197

187198
```shell
@@ -205,9 +216,11 @@ gradle clean test
205216
{{< gh-codeblock path="examples/ruby/README.md#L26" >}}
206217
{{% /tab %}}
207218
{{% tab header="JavaScript" %}}
219+
208220
```shell
209221
mocha runningTests.spec.js
210222
```
223+
211224
{{% /tab %}}
212225
{{< tab header="Kotlin" >}}
213226
{{< badge-code >}}
@@ -242,7 +255,7 @@ Here's an example of that code using a test runner:
242255

243256
## Next Steps
244257

245-
Take what you've learned and build out your Selenium code!
258+
Take what you've learned and build out your Selenium code!
246259

247260
As you find more functionality that you need, read up on the rest of our
248261
[WebDriver documentation]({{< ref "/documentation/webdriver/" >}}).

0 commit comments

Comments
 (0)