README.md 1.5 KB
Newer Older
泰斯特Test's avatar
泰斯特Test 已提交
1 2
# violent-webdriver
violent-webdriver is created by post-packaging selenium webdriver,  violent-webdriver has many convinient functions
泰斯特Test's avatar
泰斯特Test 已提交
3
which can highly insure the browser operation, you don't need to worry about whether the element is really present
泰斯特Test's avatar
泰斯特Test 已提交
4
on current page or clickable at specific time while using violent-webdriver. it will handle this sort
泰斯特Test's avatar
泰斯特Test 已提交
5
of annoying problems
泰斯特Test's avatar
泰斯特Test 已提交
6

泰斯特Test's avatar
泰斯特Test 已提交
7
Find the latest version on github : https://github.com/amazingTest/violent-webdriver
泰斯特Test's avatar
泰斯特Test 已提交
8 9 10

## Installation
The last stable release is available on PyPI and can be installed with pip.
泰斯特Test's avatar
泰斯特Test 已提交
11
**make sure that Chrome has been installed and match the selenium version** 
泰斯特Test's avatar
泰斯特Test 已提交
12

泰斯特Test's avatar
泰斯特Test 已提交
13
    $ pip install selenium
泰斯特Test's avatar
泰斯特Test 已提交
14

泰斯特Test's avatar
泰斯特Test 已提交
15
    $ pip install violent-webdriver
泰斯特Test's avatar
泰斯特Test 已提交
16

泰斯特Test's avatar
泰斯特Test 已提交
17 18 19 20 21
## Best Practice
Firstly, create a python file: c:\folder\mytest.py

    # c:\folder\mytest.py
    from violent_webdriver import Chrome
泰斯特Test's avatar
泰斯特Test 已提交
22

泰斯特Test's avatar
泰斯特Test 已提交
23
    dr = Chrome.violent_chromedriver(executable_path=[CHROMEDRIVER_PATH], use_mobile_emulation=True)
泰斯特Test's avatar
泰斯特Test 已提交
24
    dr.get('http://www.baidu.com')
泰斯特Test's avatar
泰斯特Test 已提交
25 26
    dr.v_send_keys(locate_rule={'tag name': 'input', 'name': 'word'}, message='test')
    dr.v_click(locate_rule={'tag name': 'button', 'class': 'se-bn'})
泰斯特Test's avatar
泰斯特Test 已提交
27 28

then use your IDE to run this script or
泰斯特Test's avatar
泰斯特Test 已提交
29 30

    $ python c:\folder\mytest.py
泰斯特Test's avatar
泰斯特Test 已提交
31

泰斯特Test's avatar
泰斯特Test 已提交
32 33 34
if successful, you will see the search result of 'test' by a mobile emulated browser

For more code examples, please refer to the examples folder in source distribution or
泰斯特Test's avatar
泰斯特Test 已提交
35
visit https://github.com/amazingTest/violent-webdriver/tree/master/examples
泰斯特Test's avatar
泰斯特Test 已提交
36 37

## Contact me
泰斯特Test's avatar
泰斯特Test 已提交
38
For information and suggestions you can contact me at 523314409@qq.com