@@ -94,10 +94,14 @@ browser will exit entirely.::
94
94
Using Selenium to write tests
95
95
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
96
96
97
- Selenium will be used mostly for writing test cases. You can write
98
- test cases using Python's unittest module. Here is the modified
99
- example which uses unittest module. This is a test for python.org
100
- search functionality::
97
+ Selenium is mostly used for writing test cases. The `selenium `
98
+ package itself doesn't provide a testing tool/framework. You can
99
+ write test cases using Python's unittest module. The other choices as
100
+ a tool/framework are py.test and nose.
101
+
102
+ In this chapter, we use `unittest ` as the framework of choice. Here
103
+ is the modified example which uses unittest module. This is a test
104
+ for `python.org ` search functionality::
101
105
102
106
import unittest
103
107
from selenium import webdriver
@@ -133,6 +137,9 @@ You can run the above test case from a shell like this::
133
137
134
138
OK
135
139
140
+ The above results shows that, the test has been successfully
141
+ completed.
142
+
136
143
137
144
Walk through of the example
138
145
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -191,7 +198,7 @@ in it::
191
198
192
199
.. note ::
193
200
194
- The `assertIn ` API is only available in Python 2.7 unittest module .
201
+ The `assertIn ` API is only available in Python 2.7 and above .
195
202
196
203
WebDriver offers a number of ways to find elements using one of the
197
204
`find_element_by_* ` methods. For example, the input text element can
0 commit comments