1
1
---
2
- title : " Organizing and Executing Selenium in Tests "
3
- linkTitle : " Running Tests "
2
+ title : " Organizing and Executing Selenium Code "
3
+ linkTitle : " Using Selenium "
4
4
weight : 10
5
5
description : >
6
- Scaling Selenium execution with a Test Runner Framework
6
+ Scaling Selenium execution with an IDE and a Test Runner library
7
7
---
8
8
9
+ {{< alert-content >}}
10
+ This page is very incomplete and has placeholders for things that need to be added or expounded on.
11
+ {{< /alert-content >}}
12
+
9
13
If you want to run more than a handful of one-off scripts, you need to
10
- be able to organize and work with your code.
11
- Most people use Selenium for testing, so that is the context that often
12
- gets used to talk about executing Selenium code, so it is worth giving
13
- an overview of how to use Selenium in this context.
14
- Running Selenium in tests requires making assertions and using common setup and teardown code.
15
- It often involves running multiple sessions in parallel,
16
- and sometimes running specific subsets of sessions.
14
+ be able to organize and work with your code. This page should give you
15
+ ideas for how to actually do productive things with your Selenium code.
16
+
17
+ ## Common Uses
18
+
19
+ Most people use Selenium to execute automated tests for web applications,
20
+ but Selenium support any use case of browser automation.
21
+
22
+ ### Repetitive Tasks
23
+
24
+ ### Testing
25
+
26
+ Running Selenium for testing requires making assertions on actions taken by Selenium.
27
+ So a good assertion library is required. Additional features to provide structure for tests
28
+ require use of [ Test Runner] ( #test-runners )
17
29
18
30
19
31
## IDEs
20
32
21
- First and foremost, you won't be very effective in building out a test suite without a good
33
+ Regardless of how you use Selenium code,
34
+ you won't be very effective writing or executing it without a good
22
35
Integrated Developer Environment. Here are some common options...
23
36
37
+ * Eclipse
38
+ * IntelliJ
39
+ * PyCharm
40
+ * RubyMine
41
+ * Rider
42
+ * WebStorm
43
+ * VS Code
24
44
25
- ## Test Runners
45
+ ## Test Runner
46
+
47
+ Even if you aren't using Selenium for testing, if you have advanced use cases, it might make
48
+ sense to use a test runner to better organize your code. Being able to use before/after hooks
49
+ and run things in groups or in parallel can be very useful.
26
50
27
51
### Choosing
28
52
There are many different test runners available.
@@ -145,7 +169,7 @@ Use the Java bindings for Kotlin.
145
169
### Executing
146
170
147
171
{{< tabpane text=true langEqualsHeader=true >}}
148
- {{< tab header="Java" > }}
172
+ {{% tab header="Java" % }}
149
173
### Maven
150
174
151
175
``` shell
@@ -158,7 +182,7 @@ mvn clean test
158
182
gradle clean test
159
183
```
160
184
161
- {{< /tab > }}
185
+ {{% /tab % }}
162
186
{{% tab header="Python" %}}
163
187
{{< badge-code >}}
164
188
{{% /tab %}}
@@ -168,11 +192,11 @@ gradle clean test
168
192
{{< tab header="Ruby" >}}
169
193
{{< badge-code >}}
170
194
{{< /tab >}}
171
- {{< tab header="JavaScript" > }}
195
+ {{% tab header="JavaScript" % }}
172
196
``` shell
173
197
mocha runningTests.spec.js
174
198
```
175
- {{< /tab > }}
199
+ {{% /tab % }}
176
200
{{< tab header="Kotlin" >}}
177
201
{{< badge-code >}}
178
202
{{< /tab >}}
@@ -185,16 +209,16 @@ Here's an example of that code using a test runner:
185
209
186
210
{{< tabpane text=true langEqualsHeader=true >}}
187
211
{{< tab header="Java" >}}
188
- {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/RunningTestsTest .java" >}}
212
+ {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/UsingSeleniumTest .java" >}}
189
213
{{< /tab >}}
190
214
{{< tab header="Python" >}}
191
- {{< gh-codeblock path="examples/python/tests/getting_started/test_running_tests .py" >}}
215
+ {{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests .py" >}}
192
216
{{< /tab >}}
193
217
{{< tab header="CSharp" >}}
194
- {{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/RunningTestsTest .cs" >}}
218
+ {{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/UsingSeleniumTest .cs" >}}
195
219
{{< /tab >}}
196
220
{{< tab header="Ruby" >}}
197
- {{< gh-codeblock path="examples/ruby/spec/getting_started/running_tests_spec .rb" >}}
221
+ {{< gh-codeblock path="examples/ruby/spec/getting_started/using_selenium_spec .rb" >}}
198
222
{{< /tab >}}
199
223
{{< tab header="JavaScript" >}}
200
224
{{< badge-code >}}
0 commit comments