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
(<i>Requires **[Git and Python/Pip](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/install_python_pip_git.md)**[<imgsrc="https://img.shields.io/badge/python-2.7,_3.x-22AADD.svg"alt="Python versions" />](https://www.python.org/downloads/). Optionally, you may want to use a [Python virtual environment](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/virtualenv_instructions.md) to isolate Python dependencies between projects.</i>)
15
+
(<i>Requires **[Python/Pip](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/install_python_pip_git.md)**[<imgsrc="https://img.shields.io/badge/python-2.7,_3.x-22AADD.svg"alt="Python versions" />](https://www.python.org/downloads/). Optionally, you may want to use a [Python virtual environment](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/virtualenv_instructions.md) to isolate Python dependencies between projects.</i>)
16
16
17
-
**Make sure you're using the latest versions of Pip and Setuptools:**
18
-
```
19
-
python -m pip install -U pip setuptools
20
-
```
21
-
* (Depending on your user permissions, you may need to add ``--user`` to the command if you're not inside a [Python virtual environment](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/virtualenv_instructions.md), or use "[sudo](https://en.wikipedia.org/wiki/Sudo)" on a UNIX-based OS if you're getting errors during installation.)
22
-
23
-
#### Clone SeleniumBase from GitHub:
17
+
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3a.png"title="SeleniumBase"height="32"> Git clone and install SeleniumBase:
(<i>A Git GUI tool like [SourceTree](https://www.sourcetreeapp.com/) or [GitHub Desktop](https://desktop.github.com/) may help.</i>)
28
-
29
-
#### Install SeleniumBase:
30
-
If installing SeleniumBase from a local clone, use:
31
-
```
32
20
cd SeleniumBase
33
-
pip install -r requirements.txt -U
34
-
python setup.py install
21
+
pip install .
35
22
```
36
-
* (Use ``python setup.py develop`` if inside a virtual environment.)
37
23
38
-
If installing SeleniumBase from [PyPI](https://pypi.python.org/pypi/seleniumbase)[<imgsrc="https://img.shields.io/badge/pypi-seleniumbase-22AAEE.svg"alt="pypi" />](https://pypi.python.org/pypi/seleniumbase), use:
24
+
You can also install SeleniumBase from [PyPI](https://pypi.python.org/pypi/seleniumbase):[<imgsrc="https://img.shields.io/badge/pypi-seleniumbase-22AAEE.svg"alt="pypi" />](https://pypi.python.org/pypi/seleniumbase)
39
25
```
40
-
pip install seleniumbase -U --no-cache-dir
26
+
pip install seleniumbase
41
27
```
28
+
* (Add ``--upgrade`` to get the latest packages and ``--no-cache-dir`` to force a reinstall.)
42
29
43
-
If installing SeleniumBase from GitHub, use:
30
+
You can also install a specific GitHub branch of SeleniumBase:
#### Download a web driver to your System Path or to the [seleniumbase/drivers](https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/drivers) folder:
35
+
###<imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3a.png"title="SeleniumBase"height="32"> Download a web driver:
49
36
50
-
SeleniumBase can download a driver to the seleniumbase/drivers folder with the ``install`` command:
37
+
SeleniumBase can download a web driver to the [seleniumbase/drivers](https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/drivers) folder with the ``install`` command:
51
38
```
52
39
seleniumbase install chromedriver
53
40
```
54
41
* (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 Internet Explorer.)
55
42
56
-
####Run a test on Chrome:
43
+
###<imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3a.png"title="SeleniumBase"height="32"> Run a test on Chrome:
57
44
```
58
45
cd examples
59
46
pytest my_first_test.py --browser=chrome
60
47
```
61
48
* (Chrome is the default browser if not specified with ``--browser``)
62
49
63
-
**Here's what [my_first_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py) looks like:**
64
-
65
-
```python
66
-
from seleniumbase import BaseCase
67
-
68
-
classMyTestClass(BaseCase):
69
-
70
-
deftest_basic(self):
71
-
self.open("https://xkcd.com/353/")
72
-
self.assert_element('img[alt="Python"]')
73
-
self.click('a[rel="license"]')
74
-
self.assert_text("free to copy", "div center")
75
-
self.open("https://xkcd.com/1481/")
76
-
title =self.get_attribute("#comic img", "title")
77
-
self.assert_true("86,400 seconds per day"in title)
78
-
self.click("link=Blag")
79
-
self.assert_text("The blag of the webcomic", "h2")
80
-
self.update_text("input#s", "Robots!\n")
81
-
self.assert_text("Hooray robots!", "#content")
82
-
self.open("https://xkcd.com/1319/")
83
-
self.assert_exact_text("Automation", "#ctitle")
84
-
```
85
-
(<i>By default, [CSS Selectors](https://www.w3schools.com/cssref/css_selectors.asp) are used for finding page elements.</i>)
50
+
**Check out [my_first_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py) to see what a simple test looks like:**
51
+
* (<i>By default, [CSS Selectors](https://www.w3schools.com/cssref/css_selectors.asp) are used for finding page elements.</i>)
Copy file name to clipboardExpand all lines: help_docs/install_python_pip_git.md
+9-2Lines changed: 9 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,9 @@
4
4
5
5
You can [download Git from here](http://git-scm.com/downloads).
6
6
7
-
(You can also download the SeleniumBase repository right from GitHub and skip all the git-related commands.)
7
+
(<i>A Git GUI tool like [SourceTree](https://www.sourcetreeapp.com/) or [GitHub Desktop](https://desktop.github.com/) can help you with Git commands.</i>)
8
+
9
+
(You can also download SeleniumBase from GitHub without using git-related commands.)
8
10
9
11
### [Python 2.7 or 3.x](https://www.python.org/downloads/)
10
12
@@ -46,5 +48,10 @@ You can also get pip (or fix pip) by using:
* (If you get SSL errors while trying to install packages with pip, see [this Stackoverflow post](https://stackoverflow.com/questions/49768770/not-able-to-install-python-packages-ssl-tlsv1-alert-protocol-version), which tells you to run the above command.)
49
52
50
-
(If you get SSL errors while trying to install packages with pip, see [this Stackoverflow post](https://stackoverflow.com/questions/49768770/not-able-to-install-python-packages-ssl-tlsv1-alert-protocol-version), which tells you to run the above command.)
53
+
**Keep Pip and Setuptools up-to-date:**
54
+
```
55
+
python -m pip install -U pip setuptools
56
+
```
57
+
* (Depending on your user permissions, you may need to add ``--user`` to the command if you're not inside a [Python virtual environment](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/virtualenv_instructions.md), or use "[sudo](https://en.wikipedia.org/wiki/Sudo)" on a UNIX-based OS if you're getting errors during installation.)
0 commit comments