[<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)
[<img src="https://img.shields.io/github/release/seleniumbase/SeleniumBase.svg" />](https://github.com/seleniumbase/SeleniumBase/releases) [<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="https://img.shields.io/github/stars/seleniumbase/seleniumbase.svg" alt="GitHub Stars" />](https://github.com/seleniumbase/SeleniumBase/stargazers)<br />
A reliable test automation framework that extends [Pytest](https://docs.pytest.org/en/latest/) and uses [Selenium-WebDriver](https://www.seleniumhq.org/).
## <img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="32"> Quick Start
(<i>Requires [Git](https://git-scm.com/) and [Python](https://www.python.org/downloads/) [<img src="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>)
#### Clone SeleniumBase from GitHub:
```
git clone https://github.com/seleniumbase/SeleniumBase.git
```
#### Upgrade [pip](https://pypi.org/project/pip/) and [setuptools](https://pypi.org/project/setuptools/) to the latest versions:
```
python -m pip install -U pip setuptools
```
* (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.)
#### Install SeleniumBase:
```
cd SeleniumBase
pip install -U -r requirements.txt
python setup.py install
```
* (Use ``python setup.py develop`` if configuring seleniumbase inside a virtual environment.)
* (You can also get seleniumbase from the Python Package Index, [<img src="https://img.shields.io/pypi/v/seleniumbase.svg" alt="Version" />](https://pypi.python.org/pypi/seleniumbase))
#### Install a web driver to the [seleniumbase/drivers](https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/drivers) folder:
```
seleniumbase install chromedriver
```
#### Run a test on chrome:
```
cd examples
pytest my_first_test.py --browser=chrome
```
* (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.)
<img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="32">
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.
Try out Demo Mode to see what what's being tested in real time! (Chrome is the default browser if not specified.)
```
pytest my_first_test.py --demo_mode
```
<img src="https://cdn2.hubspot.net/hubfs/100006/sb_demo_mode.gif" title="SeleniumBase" height="270"><br>
(Above: Actual demo of [my_first_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py) running on [xkcd.com](https://xkcd.com/353/))
There are <b>many more examples</b> to try out from the [SeleniumBase/examples](https://github.com/seleniumbase/SeleniumBase/blob/master/examples) folder, which you can run easily if you clone SeleniumBase.
<img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="32">
Check out [SeleniumBase Website Tours](https://github.com/seleniumbase/SeleniumBase/tree/master/examples/tour_examples) (in the ``examples/tour_examples`` folder). It's the most efficient website onboarding experience available (and it's free too). Find the [Tours ReadMe here](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md).
```
cd tour_examples
pytest google_tour.py
```
<img src="https://cdn2.hubspot.net/hubfs/100006/google_tour_3.gif" title="SeleniumBase Tour of Google" height="260"><br>
(Above: Actual demo of [google_tour.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/google_tour.py) running on [google.com](https://google.com))
<img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="32">
For more detailed steps on getting started, see the [**Detailed Instructions**](#seleniumbase_installation) section.
## <img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_box2.png" title="SeleniumBase" height="32"> Learn More:
#### **No more repetitive WebDriver code:**<br />
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>)
#### **Simple Python syntax makes coding easy:**<br />
<img src="https://cdn2.hubspot.net/hubfs/100006/images/my_first_test_image.png" title="SeleniumBase Python Code" height="280">
(<i>By default, [CSS Selectors](https://www.w3schools.com/cssref/css_selectors.asp) are used for finding page elements.</i>)
#### **Run tests with Pytest or Nose in any browser:**<br />
(<i>Using **Pytest** is strongly recommended</i>)
```
pytest my_first_test.py --browser=chrome
nosetests test_suite.py --browser=firefox
```
Python methods that start with ``test_`` will automatically be run when using ``pytest`` or ``nosetests`` on a Python file, (<i>or on folders containing Python files</i>).
#### **No more messy code:**<br />
This long line of standard WebDriver code,
```python
self.driver.find_element_by_css_selector("textarea").send_keys("text")
```
...becomes the following in SeleniumBase:
```python
self.update_text("textarea", "text")
```
(<i>You can still use ``self.driver`` in your code.</i>)
#### **No more flaky tests:**<br />
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 code.
#### **Assist manual QA with automation:**<br />
SeleniumBase includes an automated/manual hybrid solution called **[MasterQA](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/masterqa/ReadMe.md)**, which speeds up manual testing by having automation perform all the web browser actions while the manual tester only validates what is seen.
#### **Integrate with your favorite tools:**<br />
SeleniumBase is compatible with [Selenium Grid](https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/utilities/selenium_grid), [MySQL](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/core/testcase_manager.py), [Docker](https://github.com/seleniumbase/SeleniumBase/blob/master/integrations/docker/ReadMe.md), [NodeJS](https://github.com/seleniumbase/SeleniumBase/tree/master/integrations/node_js), [Google Cloud](https://github.com/seleniumbase/SeleniumBase/tree/master/integrations/google_cloud/ReadMe.md), and [AWS](#amazon_section).
#### **Automate tedious business tasks:**<br />
Beyond test automation, SeleniumBase is perfect for automating tedious business tasks that you would perform in a web browser.
#### **Lots of happy users & customers:**<br />
To learn about businesses using SeleniumBase, [Click Here](https://github.com/seleniumba
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
资源分类:Python库 所属语言:Python 资源全名:seleniumbase-1.17.15.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
seleniumbase-1.17.15.tar.gz (81个子文件)
seleniumbase-1.17.15
MANIFEST.in 592B
seleniumbase
console_scripts
logo_helper.py 2KB
sb_install.py 13KB
run.py 8KB
sb_mkdir.py 10KB
__init__.py 0B
core
proxy_helper.py 3KB
capabilities_parser.py 3KB
mysql_conf.py 412B
mysql.py 2KB
style_sheet.py 5KB
report_helper.py 8KB
download_helper.py 2KB
__init__.py 0B
s3_manager.py 3KB
log_helper.py 5KB
browser_launcher.py 21KB
create_db_tables.sql 972B
tour_helper.py 30KB
application_manager.py 695B
testcase_manager.py 4KB
config
ad_block_list.py 1KB
proxy_list.py 997B
__init__.py 0B
settings.py 5KB
utilities
selenium_grid
start-grid-hub.bat 92B
register-grid-node.bat 361B
start-grid-hub.sh 104B
grid_node.py 4KB
grid_hub.py 3KB
font_color 468B
grid-hub 3KB
__init__.py 0B
register-grid-node.sh 373B
grid-node 4KB
download_selenium_server.py 2KB
selenium_ide
convert_ide.py 27KB
__init__.py 0B
__init__.py 0B
plugins
basic_test_info.py 2KB
base_plugin.py 8KB
page_source.py 2KB
__init__.py 0B
selenium_plugin.py 8KB
db_reporting_plugin.py 5KB
screen_shots.py 1KB
s3_logging_plugin.py 2KB
pytest_plugin.py 9KB
drivers
__init__.py 0B
__init__.py 173B
common
encryption.py 5KB
obfuscate.py 894B
decorators.py 4KB
__init__.py 0B
unobfuscate.py 932B
masterqa
master_qa.py 17KB
__init__.py 0B
fixtures
constants.py 5KB
js_utils.py 24KB
xpath_to_css.py 5KB
errors.py 414B
base_case.py 135KB
page_utils.py 2KB
__init__.py 0B
page_actions.py 19KB
email_manager.py 17KB
seleniumbase.egg-info
PKG-INFO 46KB
requires.txt 320B
SOURCES.txt 3KB
entry_points.txt 578B
top_level.txt 13B
.DS_Store 6KB
dependency_links.txt 1B
.travis.yml 2KB
PKG-INFO 46KB
pytest.ini 161B
setup.cfg 115B
requirements.txt 325B
setup.py 4KB
.gitignore 828B
README.md 39KB
共 81 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 14w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功