pycharm配置robot

1.python,pycharm已经安装

2.安装robotframework(看情况,也可只安装前几个主要的库)

#保存为package.txt文件,放在某个目录下
robotframework
robotframework-requests 
pyMySQL 
robotframework-databaseLibrary 
robotframework-selenium2Library 
robotframework-seleniumlibrary
kafka-python 
redis 
robotframework-httplibrary 
robotframework-jsonlibrary 
robotframework-kafkalibrary 
robotframework-redislibrary 
robotframework-sshlibrary
robot 
matplotlib 
jira 
pillow 
robotframework-pabot 
pyzbar 
xlrd==1.2.0 
impyla==0.17.0 
clickhouse-driver==0.2.1

打开cmd,执行以下命令:

注意:D:\package.txt按本机目录调整

pip --default-timeout=100 install -r D:\package.txt  -i https://pypi.tuna.tsinghua.edu.cn/simple

3.pycharm插件安装

File——>Settings——>Plugins

 

 4.pycharm配置

4.1在pycharm的File->Settings界面,左侧列表选中Editor->File Types,在右侧列表选择Robot Feature,再点击下面的添加

 4.2.新建pybot.bat文件

按照本机目录调整

@Echo off
C:\Program Files\Python37\python.exe -m robot.run %*
4.3.配置运行robot脚本的执行套件

Settings——>Tools——>External Tools——>

 

 TestSuite

Robot Run TestSuite
C:\Program Files\Python37\Scripts\pybot.bat
-d results $FileName$
$FileDir$

 

Case

Robot Run SingleTestCase
C:\Program Files\Python37\Scripts\pybot.bat
-d results -t "$SelectedText$" ./
$FileDir$

 

posted @ 2021-12-22 15:16  wind_y  阅读(279)  评论(0编辑  收藏  举报