Robot Framework重点

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Robot Framework重点相关的知识,希望对你有一定的参考价值。

参考技术A

执行多个关键字,多个关键字之间使用AND连接起来

套件

用例

robot --pythonpath . --name 回归测试 tc

robot --pythonpath . --loglevel DEBUG --name 回归测试 tc

我们可以通过--test --suite 来指定执行哪些用例或者套件,而且还支持用通配符的方式
--test Example # 执行名为excample的用例
--test mytest --test yourtest # 执行名为mytest和yourtest的用例
--test example* # 执行名字以example开头的用例
--suite mysuite # 执行名为mysuite的套件

-d OutputDirectory 输出到目录
-o output.xml 数据内容
-l log.html 日志
-r report.html 测试报告
在执行目录后,其它参数前

如果有的时候,参数太长,我们通常可以使用参数文件,我们可以把所有的参数都放在参数文件中(argfilename),比如:
--pythonpath .
--name 回归测试
--test *tc00001
--test *tc00002
tc
命令就只需要:robot -A argfilename

ROBOT_LIBRARY_SCOPE= \'GLOBAL\' # 使用python类做为robot关键字时,类中要加入这个静态属性,robot导入时只会产生一个实例

套件目录不支持Default Tags

Robot Framework应用——Mac环境下Robot Framework的安装及简单实用

转载请注明出处:http://blog.csdn.net/dongdong9223/article/details/116591032
本文出自【我是干勾鱼的博客

下载robotframework

$ pip install robotframework
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting robotframework
  Downloading robotframework-4.0.1-py2.py3-none-any.whl (655 kB)
     |████████████████████████████████| 655 kB 15 kB/s 
Installing collected packages: robotframework
Successfully installed robotframework-4.0.1

下载docutils

$ pip install docutils
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting docutils
  Downloading docutils-0.17.1-py2.py3-none-any.whl (575 kB)
     |████████████████████████████████| 575 kB 17 kB/s 
Installing collected packages: docutils
Successfully installed docutils-0.17.1

查看robot版本

$ robot --version
Robot Framework 4.0.1 (Python 2.7.10 on darwin)

下载robotframework-ride

$ pip install robotframework-ride
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting robotframework-ride
  Downloading robotframework-ride-1.7.4.2.tar.gz (846 kB)
     |████████████████████████████████| 846 kB 1.9 MB/s 
Collecting wxPython<=4.0.7.post2
  Downloading wxPython-4.0.7.post2-cp27-cp27m-macosx_10_9_x86_64.whl (16.9 MB)
     |████████████████████████████████| 16.9 MB 543 kB/s 
Collecting PyPubSub
  Downloading PyPubSub-3.3.0.zip (87 kB)
     |████████████████████████████████| 87 kB 2.0 MB/s 
Collecting Pygments
  Downloading Pygments-2.5.2-py2.py3-none-any.whl (896 kB)
     |████████████████████████████████| 896 kB 1.2 MB/s 
Collecting numpy<1.17; python_version <= "2.7"
  Downloading numpy-1.16.6-cp27-cp27m-macosx_10_9_x86_64.whl (13.9 MB)
     |████████████████████████████████| 13.9 MB 2.6 MB/s 
Collecting pillow
  Downloading Pillow-6.2.2-cp27-cp27m-macosx_10_6_intel.whl (3.9 MB)
     |████████████████████████████████| 3.9 MB 2.4 MB/s 
Collecting six
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Building wheels for collected packages: robotframework-ride, PyPubSub
  Building wheel for robotframework-ride (setup.py) ... done
  Created wheel for robotframework-ride: filename=robotframework_ride-1.7.4.2-py2-none-any.whl size=950980 sha256=0f6731366cd527a42d814ce37e9e38c5168270a6c5ffdc09760eac832d5064fd
  Stored in directory: /Users/yuhaidong/Library/Caches/pip/wheels/94/e1/c4/dc60488f661a4037adf76d39a490e74950e16919be1ed49d75
  Building wheel for PyPubSub (setup.py) ... done
  Created wheel for PyPubSub: filename=PyPubSub-3.3.0-py2-none-any.whl size=80830 sha256=24fc86e451775032cf302304bb6e618515919ba5923b1a1c1956745e23cbd11d
  Stored in directory: /Users/yuhaidong/Library/Caches/pip/wheels/7c/fb/b6/1728423876af6e29b6a8971bf8a5f03b34c890e03489accb12
Successfully built robotframework-ride PyPubSub
Installing collected packages: numpy, pillow, six, wxPython, PyPubSub, Pygments, robotframework-ride
Successfully installed PyPubSub-3.3.0 Pygments-2.5.2 numpy-1.16.6 pillow-6.2.2 robotframework-ride-1.7.4.2 six-1.16.0 wxPython-4.0.7.post2

下载robotframework-selenium2library

$ pip install robotframework-selenium2library
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting robotframework-selenium2library
  Downloading robotframework_selenium2library-3.0.0-py2.py3-none-any.whl (6.2 kB)
Collecting robotframework-seleniumlibrary>=3.0.0
  Downloading robotframework_seleniumlibrary-4.5.0-py2.py3-none-any.whl (89 kB)
     |████████████████████████████████| 89 kB 570 kB/s 
Collecting robotframework-pythonlibcore>=2.1.0
  Downloading robotframework_pythonlibcore-2.2.1-py2.py3-none-any.whl (10 kB)
Collecting selenium>=3.141.0
  Downloading selenium-3.141.0-py2.py3-none-any.whl (904 kB)
     |████████████████████████████████| 904 kB 1.7 MB/s 
Requirement already satisfied: robotframework>=3.1.2 in /Users/yuhaidong/py_virtualenv/rpa/lib/python2.7/site-packages (from robotframework-seleniumlibrary>=3.0.0->robotframework-selenium2library) (4.0.1)
Collecting urllib3
  Downloading urllib3-1.26.4-py2.py3-none-any.whl (153 kB)
     |████████████████████████████████| 153 kB 2.8 MB/s 
Installing collected packages: robotframework-pythonlibcore, urllib3, selenium, robotframework-seleniumlibrary, robotframework-selenium2library
Successfully installed robotframework-pythonlibcore-2.2.1 robotframework-selenium2library-3.0.0 robotframework-seleniumlibrary-4.5.0 selenium-3.141.0 urllib3-1.26.4

以上是关于Robot Framework重点的主要内容,如果未能解决你的问题,请参考以下文章

Robot Framework应用——Mac环境下Robot Framework的安装及简单实用

Robot Framework应用——Mac环境下Robot Framework的安装及简单实用

Robot Framework - 从带有参数的其他 *.robot 脚本调用 *.robot 脚本

用Python写Robot Framework测试

mac环境下搭建Robot framework

robot framework数据库操作