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
SeleniumBase simplifies browser-based test automation with [WebDriver](https://docs.microsoft.com/en-us/microsoft-edge/webdriver) & [Pytest](https://github.com/pytest-dev/pytest).
5
+
A reliable solution for fast & simple browser automation and testing with [WebDriver](https://docs.microsoft.com/en-us/microsoft-edge/webdriver) & [Pytest](https://github.com/pytest-dev/pytest).
6
6
7
-
#### Quick start in a few steps: (requires[Python](https://www.python.org/downloads/))
7
+
#### Quick start in a few steps: (Requires[Python](https://www.python.org/downloads/) and [Git](https://git-scm.com/))
The ``seleniumbase mkdir [NAME]`` command creates a new folder with sample tests. To use a different browser other than Chrome, use ``seleniumbase install [DRIVER]`` with ``edgedriver`` (Microsoft Edge) or ``geckodriver`` (Firefox). Then you can use ``--browser=edge`` or ``--browser=firefox`` to run tests on those browsers. ``--browser=chrome`` is the default option.
22
+
SeleniumBase has a very flexible [command line interface](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md) to change how your tests run. The following will run the same test from above using Nosetests and Firefox with geckodriver (although Pytest is recommended over Nosetests):
23
+
24
+
```bash
25
+
seleniumbase install geckodriver
26
+
nosetests my_first_test.py --browser=firefox
27
+
```
28
+
29
+
Try out Demo Mode to see what what's being tested in real time! (Chrome is the default browser if not specified.)
19
30
20
-
**Slow-motion demo of [my_first_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py) running:**<br>
(Above: Actual demo of [my_first_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py) running against [xkcd.com](http://xkcd.com/353/))
22
37
23
38
There are many more examples to try out from the [SeleniumBase/examples](https://github.com/seleniumbase/SeleniumBase/blob/master/examples) directory, which you can run easily if you clone SeleniumBase.
24
39
40
+
Try out SeleniumBase Website Tours (from the ``examples/tour_examples`` folder). It's the best website onboarding experience available (and it's free too). Find the [WebSite Tours ReadMe here](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md).
(Above: Actual demo of [google_tour.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/google_tour.py) running against [google.com](https://google.com))
49
+
25
50
For more detailed steps on getting started, see the [**Detailed Instructions**](#seleniumbase_installation) section.
If you want to run tests headlessly, use ``--headless``, which you'll need to do if your system lacks a GUI interface. Even if your system does have a GUI interface, it may still support headless browser automation.
207
232
233
+
To run Pytest multithreaded on multiple CPUs at the same time, add ``-n=NUM`` or ``-n NUM`` on the command line, where NUM is the number of CPUs you want to use.
234
+
235
+
If you want to pass additional data from the command line to your tests, you can use ``--data=STRING``. Now inside your tests, you can use ``self.data`` to access that.
### **Using SeleniumBase as your personal framework:**
240
+
241
+
You can install SeleniumBase without cloning the repo by doing this:
242
+
243
+
```bash
244
+
python -m pip install -U pip
245
+
pip install -U seleniumbase --no-cache-dir
246
+
```
247
+
248
+
Now you can install webdrivers by doing this:
249
+
250
+
```bash
251
+
seleniumbase install chromedriver
252
+
seleniumbase install geckodriver
253
+
```
254
+
255
+
Remember, you'll need chromedriver if you want to run automation on Chrome, geckodriver if you want to run automation on Firefox, edgedriver for Microsoft Edge, etc.
256
+
257
+
When creating your own test directories, keep these two things in mind:
258
+
208
259
For running tests outside of the SeleniumBase repo with **Pytest**, you'll want a copy of **[pytest.ini](https://github.com/seleniumbase/SeleniumBase/blob/master/pytest.ini)** on the root folder. (Subfolders should include a blank ``__init__.py`` file.)
209
260
210
261
For running tests outside of the SeleniumBase repo with **Nosetests**, you'll want a copy of **[setup.cfg](https://github.com/seleniumbase/SeleniumBase/blob/master/setup.cfg)** on the root folder. (Subfolders should include a blank ``__init__.py`` file.)
211
262
212
-
If you want to pass additional data from the command line to your tests, you can use ``--data=STRING``. Now inside your tests, you can use ``self.data`` to access that.
263
+
(You'll be able to customize those files as needed.)
213
264
214
-
To run Pytest multithreaded on multiple CPUs at the same time, add ``-n=NUM`` or ``-n NUM`` on the command line, where NUM is the number of CPUs you want to use.
265
+
As a shortcut, you'll be able to run ``seleniumbase mkdir [DIRECTORY_NAME]`` to create a new folder that already contains necessary files and some example tests that you can run. Example:
Copy file name to clipboardExpand all lines: help_docs/webdriver_installation.md
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,8 @@ To run web automation, you'll need to download a web driver for each browser you
7
7
seleniumbase install chromedriver
8
8
seleniumbase install geckodriver
9
9
seleniumbase install edgedriver
10
+
seleniumbase install iedriver
11
+
seleniumbase install operadriver
10
12
```
11
13
12
14
If you plan on using the [Selenium Grid integration](https://github.com/seleniumbase/SeleniumBase/blob/master/integrations/selenium_grid/ReadMe.md) (which allows for remote webdriver), you'll need to put the drivers on your System PATH. On a Mac and Linux, ``/usr/local/bin`` is a good PATH spot. On Windows, you may need to set the System PATH under Environment Variables to include the location where you placed the driver files. As a shortcut, you could place the driver files into your Python ``Scripts/`` folder in the location where you have Python installed, which should already be on your System PATH.
0 commit comments