因为robotframework基于关键字驱动的自动化测试框架 自动化脚本编写 需要准备相关的库、以及对应驱动程序。
有些库安装若下载超时 则需要翻墙才能安装。此时可设置pypi镜像
pypi Python Package Index
1、设置默认镜像
pip config set global.index-url [pypi镜像url]
国内镜像可选
阿里云 http://mirrors.aliyun.com/pypi/simple/
清华 https://pypi.tuna.tsinghua.edu.cn/simple
豆瓣 http://pypi.douban.com/simple
2、设置临时镜像
pip install -i [pypi镜像url] [some-package]
3、查看默认定镜像
pip config list
一、安装拓展库
1、robotframework-appiumlibrary (app自动化测试扩展库)
pip install robotframework-appiumlibrary
介绍
与 Android 和 iOS 应用程序进行通信 类似于Selenium WebDriver与 Web 浏览器通信的方式。
robotframework-appiumlibrary · PyPIhttps://pypi.org/project/robotframework-appiumlibrary/2、robotframework-seleniumlibrary (web自动化测试扩展库)
pip install robotframework-seleniumlibrary
介绍
是Robot framework的 Web 测试库 内部 使用Selenium工具。
适用于 Selenium 3 和 4。它支持 Python 3.6 或更新版本。
从 3.0 版本开始 Selenium2Library 被重命名为SeleniumLibrary。
robotframework-seleniumlibrary · PyPIWeb testing library for Robot frameworkhttps://pypi.org/project/robotframework-seleniumlibrary/
3、RequestsLibrary (接口自动化测试扩展库)
pip install requests
介绍
requests · PyPIPython HTTP for Humans.https://pypi.org/project/requests/
4、其他拓展库
可根据自身需要 通过pip安装拓展库 或自行编写库。如
1 操作excel 可参考
Python读写Excel文件第三方库汇总 你想要的都在这儿 _ChrisMinions小站-CSDN博客常见库简介xlrdxlrd是一个从Excel文件读取数据和格式化信息的库 支持.xls以及.xlsx文件。http://xlrd.readthedocs.io/en/latest/ 1、xlrd支持.xls .xlsx文件的读 2、通过设置on_demand变量使open_workbook()函数只加载那些需要的sheet 从而节省时间和内存 该方法对.xlsx文件无效 。 3、...https://blog.csdn.net/qq_34617032/article/details/804339392 操作数据库 如
mysql数据库
pip install pymysql
Mongo数据库
pip install pymongo
二、查看已安装的库
pip list
三、下载驱动
若要进行web的测试 则需要对应驱动。支持IE、Chrome、FireFox。
1 Chrome浏览器
找到对应版本 下载解压 将chromedriver.exe文件放到python根目录即可。
ChromeDriver Mirrorhttp://npm.taobao.org/mirrors/chromedriver/2 IE浏览器
找到selenium版本相同的版本 下载解压IEDriverServer.exe文件放到python根目录即可。
https://selenium-release.storage.googleapis.com/index.htmlhttps://selenium-release.storage.googleapis.com/index.htmlInternet Explorer Driver使用介绍
https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver#required-configurationhttps://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver#required-configuration



