Skip to content

Commit 3ffe6a2

Browse files
committed
Update the Docs
1 parent 22fdaec commit 3ffe6a2

File tree

5 files changed

+65
-59
lines changed

5 files changed

+65
-59
lines changed

README.md

Lines changed: 54 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,46 @@
1-
[<img src="https://cdn2.hubspot.net/hubfs/100006/images/super_logo_2f1.png" title="SeleniumBase" height="48">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
1+
[<img src="https://cdn2.hubspot.net/hubfs/100006/images/super_logo_2h2.png" title="SeleniumBase" height="48">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
22

33
[<img src="https://img.shields.io/pypi/v/seleniumbase.svg" alt="Version" />](https://pypi.python.org/pypi/seleniumbase) [<img src="https://img.shields.io/badge/python-2.7,_3.*-22AADD.svg" alt="Python versions" />](https://pypi.python.org/pypi/seleniumbase) [<img src="https://travis-ci.org/seleniumbase/SeleniumBase.svg?branch=master" alt="Build Status" />](https://travis-ci.org/seleniumbase/SeleniumBase) [<img src="https://badges.gitter.im/seleniumbase/SeleniumBase.svg" alt="Join the Gitter Chat" />](https://gitter.im/seleniumbase/SeleniumBase) [<img src="http://img.shields.io/badge/license-MIT-22BBCC.svg" alt="MIT License" />](https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE) [<img src="https://img.shields.io/github/stars/seleniumbase/seleniumbase.svg" alt="GitHub Stars" />](https://github.com/seleniumbase/SeleniumBase/stargazers)<br />
44

5-
### ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") 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.
66

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.
7+
## <img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="32"> Quick Start
88

9-
## ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") 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>)
1210

11+
Clone SeleniumBase from GitHub:
1312
```
14-
python -m pip install --upgrade pip
1513
git clone https://github.com/seleniumbase/SeleniumBase.git
14+
```
15+
16+
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+
```
1620

21+
Install SeleniumBase:
22+
```
1723
cd SeleniumBase
18-
pip install -r requirements.txt --upgrade
24+
pip install -U -r requirements.txt
1925
python setup.py develop
26+
```
2027

28+
Install a web driver to the [seleniumbase/drivers](https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/drivers) folder:
29+
```
2130
seleniumbase install chromedriver
31+
```
2232

33+
Run a test on chrome:
34+
```
2335
cd examples
2436
pytest my_first_test.py --browser=chrome
2537
```
2638

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``.
2840

29-
```
30-
seleniumbase install geckodriver
31-
nosetests my_first_test.py --browser=firefox
32-
```
41+
<img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="64">
42+
43+
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.
3344

3445
Try out Demo Mode to see what what's being tested in real time! (Chrome is the default browser if not specified.)
3546

@@ -54,7 +65,7 @@ pytest google_tour.py
5465

5566
For more detailed steps on getting started, see the [**Detailed Instructions**](#seleniumbase_installation) section.
5667

57-
## ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") Learn More:
68+
## <img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="32"> Learn More:
5869

5970
#### **No more repetitive WebDriver code:**<br />
6071
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
108119
<a id="seleniumbase_installation"></a>
109120
<img src="https://cdn2.hubspot.net/hubfs/100006/images/logo_base_4b.png" title="SeleniumBase" height="100">
110121

111-
## ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") Detailed Instructions:
112-
113-
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)**.
122+
## <img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="32"> Detailed Instructions:
114123

124+
Before installation, **[install Python and Git](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/install_python_pip_git.md)**.
115125

116-
### ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") **Step 1:** Clone SeleniumBase
126+
### <img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="32"> **Step 1:** Clone SeleniumBase
117127

118128
```
119129
git clone https://github.com/seleniumbase/SeleniumBase.git
120-
121-
cd SeleniumBase
122130
```
123131

124132
(<i>A [Git](https://git-scm.com/) GUI tool like [SourceTree](http://www.sourcetreeapp.com/) may help.</i>)
125133

126-
127-
### ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") **Step 2:** Create a Virtual Environment
134+
### <img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="32"> **Step 2:** Create a Virtual Environment
128135

129136
(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).
130137

131-
132-
### ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") **Step 3:** Install SeleniumBase
138+
### <img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="32"> **Step 3:** Install SeleniumBase
133139

134140
If you're installing SeleniumBase from a cloned copy on your machine, use:
135141
```
136-
pip install -r requirements.txt --upgrade
142+
cd SeleniumBase
137143
144+
pip install -r requirements.txt --upgrade
138145
python setup.py develop
139146
```
140147

@@ -150,9 +157,21 @@ pip install -e git+https://github.com/seleniumbase/SeleniumBase.git@master#egg=s
150157

151158
(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.)
152159

160+
<a id="seleniumbase_install_a_web_driver"></a>
161+
### <img src="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)
153172

154173
<a id="seleniumbase_basic_usage"></a>
155-
### ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") **Step 4:** Run the Example Script
174+
### <img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="32"> **Step 5:** Run the Example Script
156175

157176
**Here's what the example script looks like:**
158177

@@ -241,7 +260,7 @@ If you want to pass additional data from the command line to your tests, you can
241260

242261
<img src="https://cdn2.hubspot.net/hubfs/100006/images/logo_base_4b.png" title="SeleniumBase" height="100">
243262

244-
### ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") **Using SeleniumBase as your personal framework:**
263+
### <img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="32"> **Using SeleniumBase from a [PyPI](https://pypi.org/) installation:**
245264

246265
You can install SeleniumBase without cloning the repo by doing this:
247266

@@ -250,7 +269,7 @@ python -m pip install -U pip
250269
pip install -U seleniumbase --no-cache-dir
251270
```
252271

253-
Now you can install webdrivers by doing this:
272+
You can then install webdrivers by doing this:
254273

255274
```
256275
seleniumbase install chromedriver
@@ -260,15 +279,11 @@ seleniumbase install iedriver
260279
seleniumbase install operadriver
261280
```
262281

263-
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.)
264283

265284
When creating your own test directories, keep these two things in mind:
266285

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.)
272287

273288
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:
274289

@@ -281,7 +296,7 @@ pytest my_first_test.py --browser=chrome
281296
<img src="https://cdn2.hubspot.net/hubfs/100006/images/logo_base_4b.png" title="SeleniumBase" height="100">
282297

283298
<a id="creating_visual_reports"></a>
284-
### ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") **Creating Visual Test Suite Reports:**
299+
### <img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="32"> **Creating Visual Test Suite Reports:**
285300

286301
(NOTE: Several command line args are different for Pytest vs Nosetests)
287302

@@ -313,7 +328,7 @@ nosetests my_test_suite.py --report
313328
(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.)
314329

315330

316-
### ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") **Using a Proxy Server:**
331+
### <img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="32"> **Using a Proxy Server:**
317332

318333
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.
319334

@@ -328,7 +343,7 @@ pytest proxy_test.py --proxy=proxy1
328343
```
329344

330345
<a id="utilizing_advanced_features"></a>
331-
### ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") **Production Environments & Integrations:**
346+
### <img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="32"> **Production Environments & Integrations:**
332347

333348
Here are some things you can do to setup a production environment for your testing:
334349

@@ -394,7 +409,7 @@ You'll notice that a logs folder, "latest_logs", was created to hold information
394409
<img src="https://cdn2.hubspot.net/hubfs/100006/images/logo_base_4b.png" title="SeleniumBase" height="100">
395410

396411
<a id="detailed_method_specifications"></a>
397-
### ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") **Detailed Method Specifications and Examples:**
412+
### <img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="32"> **Detailed Method Specifications and Examples:**
398413

399414
#### Navigating to a web page (and related commands)
400415

@@ -689,7 +704,7 @@ self.assertTrue(num_email_results) # true if not zero
689704
Now you can parse through the email if you're looking for specific text or want to navigate to a link listed there.
690705

691706

692-
### ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") Wrap-Up
707+
### <img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="32"> Wrap-Up
693708

694709
Congratulations on getting started with SeleniumBase!
695710

help_docs/customizing_test_runs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ pytest my_first_test.py --demo_mode --browser=chrome
2525

2626
pytest my_first_test.py --browser=firefox
2727

28-
pytest basic_script.py -s --pdb --pdb-failures
29-
30-
pytest basic_script.py --html=report.html
28+
pytest my_test_suite.py --html=report.html
3129

3230
nosetests my_test_suite.py --report --show_report
3331

3432
pytest my_test_suite.py --server=IP_ADDRESS -n 4
3533

3634
pytest my_test_suite.py --proxy=IP_ADDRESS:PORT
35+
36+
pytest test_fail.py -s --pdb --pdb-failures
3737
```
3838

3939
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.

help_docs/install_python_pip_git.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,28 +47,18 @@ brew update
4747

4848
### [Git](http://www.git-scm.com)
4949

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).
5151

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)
5353
```bash
5454
brew install git
5555
```
5656

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.)
5858

5959
<a id="virtual_environment"></a>
6060
### [VirtualEnv](http://virtualenv.readthedocs.org/en/latest/) and [VirtualEnvWrapper](http://virtualenvwrapper.readthedocs.org/en/latest/)
6161

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.
6363

64-
MAC / Linux:
65-
```bash
66-
python -m pip install --upgrade virtualenv
67-
python -m pip install --upgrade virtualenvwrapper
68-
```
69-
70-
WINDOWS:
71-
```bash
72-
python -m pip install --upgrade virtualenv
73-
python -m pip install --upgrade virtualenvwrapper-win
74-
```
64+
To learn how to create a Python virtual environment, [see this ReadMe](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/virtualenv_instructions.md).

help_docs/webdriver_installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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.
22

33

44
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:

seleniumbase/config/proxy_list.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
Example proxies in PROXY_LIST below are not guaranteed to be active or secure.
1616
If you don't already have a proxy server to connect to,
1717
you can try finding one from one of following sites:
18+
* https://www.us-proxy.org/
1819
* https://hidemy.name/en/proxy-list/?country=US&type=h#list
1920
* http://proxyservers.pro/proxy/list/protocol/http/country/US/
2021
"""
2122

2223
PROXY_LIST = {
23-
# "example1": "35.196.26.166:3128", # (Example) - set your own proxy here
24+
# "example1": "64.33.247.157:3128", # (Example) - set your own proxy here
2425
"proxy1": None,
2526
"proxy2": None,
2627
"proxy3": None,

0 commit comments

Comments
 (0)