当前位置:网站首页>Manual for automatic testing and learning of anti stepping pits, one for each tester

Manual for automatic testing and learning of anti stepping pits, one for each tester

2022-06-24 06:15:00 Code start



Learn well the pits you have trodden on in automated testing



The importance of learning automation


  • Skills necessary for salary increase !! Skills necessary for salary increase !! Skills necessary for salary increase !!
  • The testing industry is maturing , More and more technical requirements , The demand for enterprise recruitment has increased

Automated classification :


  • web automation
  • app automation
  • Interface automation
  • Performance automation

What automation

web automated testing , Web automation testing , By writing a script to simulate people on web Object does the following :


  • Element localization
  • input data
  • single click 、 double-click 、 Scroll bar operation
  • Get page data
  • Make assertions
  • Generate test reports

Development environment preparation


  • IDE
    Pycharm
    sublime
    vscode
  • Python3
    -selenium3
  • browser
    Google browser
    Firefox
    Other browsers
    Browser driven ( Google / Fox drive )

Problems encountered in installing third-party libraries ... pit

  • If you are online pip When the installation fails , One solution is : Use domestic resources

Domestic resources


  • adopt pip Command direct download , Generally, downloaded resources are stored on foreign servers , Slow download 、 An error is reported during downloading
  • Tsinghua University https://pypi.tuna.tsinghua.edu.cn/simple/
  • Alibaba cloud http://mirrors.aliyun.com/pypi/simple/
  • University of science and technology of China https://pypi.mirrors.ustc.edu.cn/simple/
  • douban (douban) http://pypi.douban.com/simple/
  • University of science and technology of China http://pypi.mirrors.ustc.edu.cn/simple/
  • Download instructions :​​pip install requests -i https://pypi.tuna.tsinghua.edu.cn/simple​

Download offline


  • First step : Download the required module package :https://pypi.org/project/xlrd/#files
  • The second step : Unzip the file
  • The third step : Enter the directory in the figure in turn , Catalog bar entry cmd Press enter
  • Step four : eject cmd window — Input python setup.py install
  • Step five : Wait until the loading is finished
     Automated test learning pit manual , One for each tester _Web automation

download Github Code , To install multiple libraries

 Automated test learning pit manual , One for each tester _Web automation _02

Running code encounters ... pit

When running code, the directory does not have a driver

 Automated test learning pit manual , One for each tester _selenium_03

Python The root directory stores the driver

 Automated test learning pit manual , One for each tester _Python_04

Driver does not match browser

 Automated test learning pit manual , One for each tester _Web automation _05

 Automated test learning pit manual , One for each tester _chrome_06

Unittest Cannot generate test report while running code

 Automated test learning pit manual , One for each tester _Web automation _07

  • You have to use Python Only the native run mode can generate reports
     Automated test learning pit manual , One for each tester _Python_08

Browser driven download

Google


  • Google browser :https://www.chromedownloads.net/chrome64win/
  • Google drives :https://npm.taobao.org/mirrors/chromedriver

firefox


  • Firefox :http://ftp.mozilla.org/pub/firefox/releases/
  • Fox drive :https://github.com/mozilla/geckodriver/releases

Download the corresponding browser driver

 ​

 ​​

 ​

Be careful : The download version number does not need to be exactly the same as the browser version number

 Automated test learning pit manual , One for each tester _python_09

If you have learned , Please give me a compliment , If you want to learn , Please join :893694563, There are technical exchanges and resource sharing in the group .



原网站

版权声明
本文为[Code start]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202211617341843.html