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
<divalign="center"><spanalign="center"><b>Create web and mobile tests, fast!</b></span></div>
13
14
<divalign="center"><spanalign="center">Take <ahref="https://selenium.dev/">Selenium</a> and <ahref="https://docs.pytest.org/en/latest/index.html">pytest</a> to the next level.</span></div>
<palign="center">(<i>Above: <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_swag_labs.py">test_swag_labs.py</a> running with mobile emulation enabled.</i>)</p>
37
41
38
42
```bash
39
43
pytest test_swag_labs.py --mobile
40
44
```
45
+
41
46
------
42
47
<div><palign="center">(<i>Below: Same test as above, but running in Demo Mode now.</i>)</p></div>
43
48
@@ -95,7 +100,7 @@ pytest my_first_test.py
95
100
* Chrome is the default browser if not specified with ``--browser=BROWSER``.
96
101
* On Linux ``--headless`` is the default behavior (running with no GUI). You can also run in headless mode on any OS. If your Linux machine has a GUI and you want to see the web browser as tests run, add ``--headed`` or ``--gui``.
97
102
98
-
**Here's an example test, [my_first_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py):**<br />
103
+
<b>Here's an example test, [my_first_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py):</b>
SeleniumBase automatically handles common WebDriver actions such as spinning up web browsers and saving screenshots during test failures. (<i><ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md">Read more about customizing test runs</a>.</i>)
153
158
154
-
#### **Simplified code:**<br />
159
+
#### Simplified code:
155
160
SeleniumBase uses simple syntax for commands, such as:
156
161
```python
157
162
self.update_text("input", "dogs\n")
@@ -169,7 +174,7 @@ As you can see, the old WebDriver way is very bad!
169
174
Use SeleniumBase to make testing much easier!
170
175
(<i>You can still use ``self.driver`` in your code.</i>)
171
176
172
-
#### **Run tests with ``pytest`` or ``nosetests`` in any browser:**<br />
177
+
#### Run tests with ``pytest`` or ``nosetests`` in any browser:
173
178
(<i>Using **pytest** is recommended. **Chrome** is the default browser.</i>)
SeleniumBase methods automatically wait for page elements to finish loading before interacting with them (*up to a timeout limit*). This means you no longer need random ``time.sleep()`` statements in your scripts.
187
192
188
-
#### **Automated/manual hybrid mode:**<br />
193
+
#### Automated/manual hybrid mode:
189
194
SeleniumBase includes a solution called <b><ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/masterqa/ReadMe.md">MasterQA</a></b>, which speeds up manual testing by having automation perform all the browser actions while the manual tester handles validatation.
190
195
191
-
#### **Feature-Rich:**<br />
196
+
#### Feature-Rich:
192
197
For a full list of SeleniumBase features, <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/features_list.md">Click Here</a>.
193
198
194
199
@@ -388,12 +393,12 @@ The ``--report`` option gives you a fancy report after your test suite completes
(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.)
394
399
395
400
396
-
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3.png"title="SeleniumBase"height="32"> **Using a Proxy Server:**
401
+
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3.png"title="SeleniumBase"height="32" />Using a Proxy Server:
397
402
398
403
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.
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3.png"title="SeleniumBase"height="32">**Changing the User-Agent:**
419
+
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3.png"title="SeleniumBase"height="32">Changing the User-Agent:
415
420
416
421
If you wish to change the User-Agent for your browser tests (Chrome and Firefox only), you can add ``--agent="USER AGENT STRING"`` as an argument on the command-line.
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3.png"title="SeleniumBase"height="32">**Building Guided Tours for Websites:**
427
+
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3.png"title="SeleniumBase"height="32">Building Guided Tours for Websites:
423
428
424
429
Learn about <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md">SeleniumBase Interactive Walkthroughs</a> (in the ``examples/tour_examples`` folder). It's great for prototyping a website onboarding experience.
425
430
426
431
<imgsrc="https://cdn2.hubspot.net/hubfs/100006/google_tour_3.gif"title="SeleniumBase Tour of Google" />
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3.png"title="SeleniumBase"height="32">**Detailed Method Specifications and Examples:**
456
+
### <imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3.png"title="SeleniumBase"height="32">Detailed Method Specifications and Examples:
452
457
453
458
#### Navigating to a web page (and related commands)
454
459
@@ -466,7 +471,7 @@ self.get_current_url() # This method returns the current page URL.
466
471
self.get_page_source() # This method returns the current page source.
467
472
```
468
473
469
-
**ProTip™:** You may need to use the get_page_source() method along with Python's find() command to parse through the source to find something that Selenium wouldn't be able to. (You may want to brush up on your Python programming skills for that.)
474
+
<b>ProTip™:</b> You may need to use the get_page_source() method along with Python's find() command to parse through the source to find something that Selenium wouldn't be able to. (You may want to brush up on your Python programming skills for that.)
470
475
```python
471
476
source =self.get_page_source()
472
477
head_open_tag = source.find('<head>')
@@ -718,12 +723,19 @@ Additionally, you can use the ``@retry_on_exception()`` decorator to specificall
718
723
719
724
#### Congratulations on getting started with SeleniumBase!
720
725
721
-
**If you see something, say something!**<br />[<imgsrc="https://img.shields.io/github/issues-closed-raw/seleniumbase/SeleniumBase.svg?color=22BB88"alt="" />](https://github.com/seleniumbase/SeleniumBase/issues?q=is%3Aissue+is%3Aclosed)[<imgsrc="https://img.shields.io/github/issues-pr-closed/seleniumbase/SeleniumBase.svg?logo=github&logoColor=white&color=22BB99" />](https://github.com/seleniumbase/SeleniumBase/pulls?q=is%3Apr+is%3Aclosed)
726
+
<p>
727
+
<div><b>If you see something, say something!</b></div>
**If you like us, give us a star!**<br />[<imgsrc="https://img.shields.io/github/stars/seleniumbase/seleniumbase.svg?color=888CFA"alt="" />](https://github.com/seleniumbase/SeleniumBase/stargazers)
[<imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/super_logo_sb.png"title="SeleniumBase"height="46.2">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md) <br /> [<imgsrc="https://img.shields.io/badge/license-MIT-22BBCC.svg"alt="" />](https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE)[<imgsrc="https://img.shields.io/github/repo-size/seleniumbase/seleniumbase.svg"alt="Size" />](https://github.com/seleniumbase/SeleniumBase/releases)[<imgsrc="https://badges.gitter.im/seleniumbase/SeleniumBase.svg"alt="Join the chat!" />](https://gitter.im/seleniumbase/SeleniumBase)
739
+
<div><ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE"><imgsrc="https://img.shields.io/badge/license-MIT-22BBCC.svg"title="SeleniumBase" /></a> <ahref="https://github.com/seleniumbase/SeleniumBase/releases"><imgsrc="https://img.shields.io/github/repo-size/seleniumbase/seleniumbase.svg"title="SeleniumBase"alt="Repo Size" /></a> <ahref="https://gitter.im/seleniumbase/SeleniumBase"><imgsrc="https://badges.gitter.im/seleniumbase/SeleniumBase.svg"title="SeleniumBase"alt="Join the chat!" /></a></div>
728
740
729
741
<ahref="https://github.com/seleniumbase/SeleniumBase"><imgsrc="https://img.shields.io/badge/tested%20with-SeleniumBase-04C38E.svg"alt="Tested with SeleniumBase" /></a>
0 commit comments