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
###  Automated Testing Made Easy
5
+
A complete framework for web automation, end-to-end testing, and [user-onboarding](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md). SeleniumBase uses [Pytest](https://github.com/pytest-dev/pytest) for running Python scripts, while using [WebDriver](https://www.seleniumhq.org/) for controlling web browsers.
6
6
7
-
SeleniumBase is a complete framework for end-to-end testing and [website walkthroughs](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md). It uses [WebDriver](https://www.seleniumhq.org/) to control web browsers while using [Pytest](https://github.com/pytest-dev/pytest) for running Python scripts.
##  Quick Start in minutes
10
-
11
-
(Requires [Python](https://www.python.org/downloads/), [Git](https://git-scm.com/), and an optional [Python virtual environment](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/virtualenv_instructions.md).)
9
+
(<i>Requires [Git](https://git-scm.com/) and [Python](https://www.python.org/downloads/). Optionally a [Python virtual environment](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/virtualenv_instructions.md).</i>)
Upgrade [pip](https://pypi.org/project/pip/) and [setuptools](https://pypi.org/project/setuptools/) if you don't have the latest versions:
17
+
```
18
+
python -m pip install -U pip setuptools
19
+
```
16
20
21
+
Install SeleniumBase:
22
+
```
17
23
cd SeleniumBase
18
-
pip install -r requirements.txt --upgrade
24
+
pip install -U -r requirements.txt
19
25
python setup.py develop
26
+
```
20
27
28
+
Install a web driver to the [seleniumbase/drivers](https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/drivers) folder:
29
+
```
21
30
seleniumbase install chromedriver
31
+
```
22
32
33
+
Run a test on chrome:
34
+
```
23
35
cd examples
24
36
pytest my_first_test.py --browser=chrome
25
37
```
26
38
27
-
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 code will run the same test from above on Firefox (geckodriver) using nosetests (<i>although pytest is recommended over nosetests</i>):
39
+
You need a different web driver for each web browser you want to run automation on: ``chromedriver`` for ``chrome``, ``edgedriver`` for ``edge``, ``geckodriver`` for ``firefox``, ``operadriver`` for ``opera``, and ``iedriver`` for ``ie``.
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.
33
44
34
45
Try out Demo Mode to see what what's being tested in real time! (Chrome is the default browser if not specified.)
35
46
@@ -54,7 +65,7 @@ pytest google_tour.py
54
65
55
66
For more detailed steps on getting started, see the [**Detailed Instructions**](#seleniumbase_installation) section.
SeleniumBase automatically handles common WebDriver actions such as spinning up web browsers, waiting for page objects to load, saving screenshots during test failures, using a proxy server, and more. (<i>[Read about customizing test runs](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md).</i>)
@@ -108,33 +119,29 @@ To see a full list of SeleniumBase features, [Click Here](https://github.com/sel
Before installation, **[install Python](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/install_python_pip_git.md)** and **[install a web driver](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/webdriver_installation.md)**.
(<i>A [Git](https://git-scm.com/) GUI tool like [SourceTree](http://www.sourcetreeapp.com/) may help.</i>)
125
133
126
-
127
-
### **Step 2:** Create a Virtual Environment
134
+
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png"title="SeleniumBase"height="32"> **Step 2:** Create a Virtual Environment
128
135
129
136
(OPTIONAL) To learn how to create a Python virtual environment, [see this ReadMe](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/virtualenv_instructions.md).
(If you encounter permission errors during installation while not using a virtual environment, you may need to add ``--user`` to your pip command. If you already have an older version of SeleniumBase installed, you may want to add ``--upgrade`` or ``-U`` to your pip command.)
152
159
160
+
<aid="seleniumbase_install_a_web_driver"></a>
161
+
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png"title="SeleniumBase"height="32"> **Step 4:** Install a Web Driver
162
+
163
+
SeleniumBase requires a web driver to run automation on web browers. For that, you'll need to either download a web driver to your path, or **[install a web driver](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/webdriver_installation.md)** with the SeleniumBase ``install`` command.
164
+
165
+
```
166
+
seleniumbase install chromedriver
167
+
seleniumbase install geckodriver
168
+
seleniumbase install edgedriver
169
+
```
170
+
171
+
(``geckodriver`` is the offical name of the Firefox driver)
153
172
154
173
<aid="seleniumbase_basic_usage"></a>
155
-
### **Step 4:** Run the Example Script
174
+
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png"title="SeleniumBase"height="32"> **Step 5:** Run the Example Script
156
175
157
176
**Here's what the example script looks like:**
158
177
@@ -241,7 +260,7 @@ If you want to pass additional data from the command line to your tests, you can
### **Using SeleniumBase as your personal framework:**
263
+
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png"title="SeleniumBase"height="32"> **Using SeleniumBase from a [PyPI](https://pypi.org/) installation:**
245
264
246
265
You can install SeleniumBase without cloning the repo by doing this:
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.
282
+
(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.)
264
283
265
284
When creating your own test directories, keep these two things in mind:
266
285
267
-
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.)
268
-
269
-
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.)
270
-
271
-
(You'll be able to customize those files as needed.)
286
+
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. 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.)
272
287
273
288
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:
(NOTE: You can add ``--show_report`` to immediately display Nosetest reports after the test suite completes. Only use ``--show_report`` when running tests locally because it pauses the test run.)
314
329
315
330
316
-
### **Using a Proxy Server:**
331
+
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png"title="SeleniumBase"height="32">**Using a Proxy Server:**
317
332
318
333
If you wish to use a proxy server for your browser tests (Chrome and Firefox only), you can add ``--proxy=IP_ADDRESS:PORT`` as an argument on the command line.
You can interchange **pytest** with **nosetests**, but using pytest is strongly recommended because developers stopped supporting nosetests. Chrome is the default browser if not specified.
Copy file name to clipboardExpand all lines: help_docs/install_python_pip_git.md
+5-15Lines changed: 5 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -47,28 +47,18 @@ brew update
47
47
48
48
### [Git](http://www.git-scm.com)
49
49
50
-
(NOTE: You can download the SeleniumBase repository right from GitHub and skip all the git-related commands. That's probably the fastest way if you want to quickly get a live demo of this tool up and running.)
50
+
You can [download Git from here](http://git-scm.com/downloads).
51
51
52
-
MAC-ONLY: (This step only works if you installed Homebrew in the previous step)
52
+
MAC-ONLY shortcut: (This step only works if you installed Homebrew in the previous step)
53
53
```bash
54
54
brew install git
55
55
```
56
56
57
-
(WINDOWS users: Skip the Homebrew part and [download Git here](http://git-scm.com/downloads).)
57
+
(You can also download the SeleniumBase repository right from GitHub and skip all the git-related commands.)
58
58
59
59
<aid="virtual_environment"></a>
60
60
### [VirtualEnv](http://virtualenv.readthedocs.org/en/latest/) and [VirtualEnvWrapper](http://virtualenvwrapper.readthedocs.org/en/latest/)
61
61
62
-
(NOTE: Virtual environments allow each your Python projects to have a unique set of packaged dependencies.)
62
+
Virtual environments allow each your Python projects to have a unique set of packaged dependencies.
To learn how to create a Python virtual environment, [see this ReadMe](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/virtualenv_instructions.md).
Copy file name to clipboardExpand all lines: help_docs/webdriver_installation.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
## Installing Google Chromedriver, Firefox Geckodriver, and Microsoft Edge Driver
1
+
## Installing Google Chromedriver, Firefox Geckodriver, Microsoft Edge Driver, etc.
2
2
3
3
4
4
To run web automation, you'll need to download a web driver for each browser you plan on using and place those on your System **[PATH](http://java.com/en/download/help/path.xml)**. Additionaly, you can place drivers in the [SeleniumBase `drivers` folder](https://github.com/seleniumbase/SeleniumBase/blob/master/drivers). If you plan on taking the latter option, here are some commands that'll automatically download the driver you need into the ``drivers`` folder once you've installed SeleniumBase:
0 commit comments