Robotframework是一个框架,是一个可以用于关键字测试驱动的框架。而RIDE(robotframework-ride)就是可以使得写robot测试用例更加方便快捷的IDE图形操作工具。
安装
因为是基于python的,所以其可以运行在多个操作系统上。这里主要介绍一下RIDE在MacOS上的使用方式。
OS版本
MacOS版本:10.13.2
wxpython
由于RIDE是基于wxpython的应用,所以首先需要保证wxpython已经得到了安装。安装命令如下:
安装命令:brew install wxpython
安装日志
liumiaocn:~ liumiao$ brew install wxpython ==> Installing dependencies for wxpython: gdbm, readline, sqlite, python@2, jpeg, libpng, libtiff, wxmac ==> Installing wxpython dependency: gdbm ==> Downloading https://homebrew.bintray.com/bottles/gdbm-1.15.high_sierra.bottle.tar.gz ######################################################################## 100.0% ==> Pouring gdbm-1.15.high_sierra.bottle.tar.gz "/usr/local/opt/sqlite/bin:$PATH"' ~/.bash_profile For compilers to find this software you may need to set: LDFLAGS: -L/usr/local/opt/sqlite/lib CPPFLAGS: -I/usr/local/opt/sqlite/include For pkg-config to find this software you may need to set: PKG_CONFIG_PATH: /usr/local/opt/sqlite/lib/pkgconfig ==> Summary "jpeg" Download failed: https://homebrew.bintray.com/bottles/jpeg-9c.high_sierra.bottle.tar.gz Warning: Bottle installation failed: building from source. ==> Downloading http://www.ijg.org/files/jpegsrc.v9c.tar.gz ######################################################################## 100.0% ==> ./configure --disable-silent-rules --prefix=/usr/local/Cellar/jpeg/9c ==> make install "libpng" Download failed: https://homebrew.bintray.com/bottles/libpng-1.6.34.high_sierra.bottle.tar.gz Warning: Bottle installation failed: building from source. ==> Downloading https://downloads.sourceforge.net/libpng/libpng-1.6.34.tar.xz ==> Downloading from https://downloads.sourceforge.net/project/libpng/libpng16/1.6.34/libpng-1.6.34.tar.xz ######################################################################## 100.0% ==> ./configure --disable-silent-rules --prefix=/usr/local/Cellar/libpng/1.6.34 ==> make ==> make test ==> make install "libtiff" Download failed: https://homebrew.bintray.com/bottles/libtiff-4.0.9_3.high_sierra.bottle.tar.gz Warning: Bottle installation failed: building from source. ==> Downloading https://download.osgeo.org/libtiff/tiff-4.0.9.tar.gz curl: (28) Resolving timed out after 5551 milliseconds Trying a mirror... ==> Downloading https://fossies.org/linux/misc/tiff-4.0.9.tar.gz ######################### 34.8% ######################################################################## 100.0% ==> Downloading https://mirrors.ocf.berkeley.edu/debian/pool/main/t/tiff/tiff_4.0.9-5.debian.tar.xz ######################################################################## 100.0% ==> Patching ==> Applying patches/CVE-2017-9935.patch patching file libtiff/tif_dir.c patching file tools/tiff2pdf.c ==> Applying patches/CVE-2017-18013.patch patching file libtiff/tif_print.c ==> Applying patches/CVE-2018-5784.patch patching file contrib/addtiffo/tif_overview.c patching file tools/tiff2pdf.c patching file tools/tiffcrop.c ==> Applying patches/CVE-2017-11613_part1.patch patching file libtiff/tif_dirread.c ==> Applying patches/CVE-2017-11613_part2.patch patching file libtiff/tif_dirread.c ==> Applying patches/CVE-2018-7456.patch patching file libtiff/tif_dirread.c patching file libtiff/tif_print.c ==> Applying patches/CVE-2017-17095.patch patching file tools/pal2rgb.c ==> ./configure --prefix=/usr/local/Cellar/libtiff/4.0.9_3 --without-x --with-jpeg-include-dir=/usr/local/opt/jpeg/include --with-jpeg- ==> make install "htmlcode">liumiaocn:~ liumiao$ brew info wxpython wxpython: stable 3.0.2.0 (bottled) Python bindings for wxWidgets https://www.wxwidgets.org/ /usr/local/Cellar/wxpython/3.0.2.0_1 (1,115 files, 39.9MB) * Poured from bottle on 2018-06-19 at 15:52:25 From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/wxpython.rb ==> Dependencies Required: python@2 "htmlcode">liumiaocn:bin liumiao$ pwd /usr/local/bin liumiaocn:bin liumiao$ ls wx ls: wx: No such file or directory liumiaocn:bin liumiao$ ln -s ../Cellar/wxpython/3.0.2.0_1/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx wx liumiaocn:bin liumiao$确认方式
liumiaocn:~ liumiao$ python -c "import wx; print wx.VERSION" /usr/local/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/_core.py:16633: UserWarning: wxPython/wxWidgets release number mismatch warnings.warn("wxPython/wxWidgets release number mismatch") (3, 0, 2, 0, '') liumiaocn:~ liumiao$虽然仍然提示warning信息,但是已经能够正常继续动作了。
安装robotframework-ride
使用pip安装robotframework-ride, 安装命令如下
安装命令:pip install robotframework-ride
启动确认
通过ride.py启动RIDE,当前版本出现了如下错误信息
liumiaocn:bin liumiao$ ride.py Wrong wxPython version. You need to install wxPython 2.8.12.1 with unicode support to run RIDE. wxPython 2.8.12.1 can be downloaded from http://sourceforge.net/projects/wxpython/files/wxPython/2.8.12.1/ liumiaocn:bin liumiao$原因确认:经过定位代码中错误出现的位置,确认到如下文件:
liumiaocn:local liumiao$ find . -name '*.py' |xargs grep 'You need to install wxPython' ./lib/python2.7/site-packages/robotide/__init__.py:You need to install wxPython 2.8.12.1 with unicode support to run RIDE. liumiaocn:local liumiao$ view ./lib/python2.7/site-packages/robotide/__init__.py liumiaocn:local liumiao$ grep supported_versions ./lib/python2.7/site-packages/robotide/__init__.py supported_versions = ["2.8"] supported_versions.append("2.9") wxversion.select(supported_versions) liumiaocn:local liumiao$对应方法1:直接将支持的版本号修改为当前的版本
liumiaocn:~ liumiao$ diff /usr/local/lib/python2.7/site-packages/robotide/__init__.py /usr/local/lib/python2.7/site-packages/robotide/__init__.py.org 37,38c37 < #supported_versions = ["2.8"] < supported_versions = ["3.0.2.0"] --- > supported_versions = ["2.8"] liumiaocn:~ liumiao$对应方法2:添加supported_versions
liumiaocn:~ liumiao$ diff /usr/local/lib/python2.7/site-packages/robotide/__init__.py /usr/local/lib/python2.7/site-packages/robotide/__init__.py.org 44d43 < supported_versions.append("3.0.2.0") liumiaocn:~ liumiao$实际上在如下行添加了对当前版本的支持
try: import wxversion from wxversion import VersionError if sys.platform == 'darwin': supported_versions.append("2.9") supported_versions.append("3.0.2.0") wxversion.select(supported_versions) import wx安装robotframework
使用pip install robotramework进行robotframework的安装
liumiaocn:~ liumiao$ pip install robotframework Collecting robotframework Downloading https://files.pythonhosted.org/packages/95/b1/4faa12e1950b9fbd00060c112fa6f828c4f3998e9b2f8c570c22db10bc88/robotframework-3.0.4.tar.gz (443kB) 100% |████████████████████████████████| 450kB 34kB/s Building wheels for collected packages: robotframework Running setup.py bdist_wheel for robotframework ... done Stored in directory: /Users/liumiao/Library/Caches/pip/wheels/8a/01/4a/fd9aef57cca0087d0bd5ceba5db39247ef375fdc4df5ebfb59 Successfully built robotframework Installing collected packages: robotframework Successfully installed robotframework-3.0.4 liumiaocn:~ liumiao$启动RIDE
在命令行输入ride.py并回车,便可启动RIDE
安装pygments
Text Edit的tab提示需要安装高亮显示用的包pygments
使用pip install pygments进行安装
liumiaocn:~ liumiao$ pip install pygments Collecting pygments Downloading https://files.pythonhosted.org/packages/02/ee/b6e02dc6529e82b75bb06823ff7d005b141037cb1416b10c6f00fc419dca/Pygments-2.2.0-py2.py3-none-any.whl (841kB) 100% |████████████████████████████████| 849kB 1.9MB/s Installing collected packages: pygments Successfully installed pygments-2.2.0 liumiaocn:~ liumiao$再次启动ride.py,已经可以正常动作了。
总结
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对的支持。如果你想了解更多相关内容请查看下面相关链接
《魔兽世界》大逃杀!60人新游玩模式《强袭风暴》3月21日上线
暴雪近日发布了《魔兽世界》10.2.6 更新内容,新游玩模式《强袭风暴》即将于3月21 日在亚服上线,届时玩家将前往阿拉希高地展开一场 60 人大逃杀对战。
艾泽拉斯的冒险者已经征服了艾泽拉斯的大地及遥远的彼岸。他们在对抗世界上最致命的敌人时展现出过人的手腕,并且成功阻止终结宇宙等级的威胁。当他们在为即将于《魔兽世界》资料片《地心之战》中来袭的萨拉塔斯势力做战斗准备时,他们还需要在熟悉的阿拉希高地面对一个全新的敌人──那就是彼此。在《巨龙崛起》10.2.6 更新的《强袭风暴》中,玩家将会进入一个全新的海盗主题大逃杀式限时活动,其中包含极高的风险和史诗级的奖励。
《强袭风暴》不是普通的战场,作为一个独立于主游戏之外的活动,玩家可以用大逃杀的风格来体验《魔兽世界》,不分职业、不分装备(除了你在赛局中捡到的),光是技巧和战略的强弱之分就能决定出谁才是能坚持到最后的赢家。本次活动将会开放单人和双人模式,玩家在加入海盗主题的预赛大厅区域前,可以从强袭风暴角色画面新增好友。游玩游戏将可以累计名望轨迹,《巨龙崛起》和《魔兽世界:巫妖王之怒 经典版》的玩家都可以获得奖励。
更新日志
- 小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE]
- 群星《欢迎来到我身边 电影原声专辑》[320K/MP3][105.02MB]
- 群星《欢迎来到我身边 电影原声专辑》[FLAC/分轨][480.9MB]
- 雷婷《梦里蓝天HQⅡ》 2023头版限量编号低速原抓[WAV+CUE][463M]
- 群星《2024好听新歌42》AI调整音效【WAV分轨】
- 王思雨-《思念陪着鸿雁飞》WAV
- 王思雨《喜马拉雅HQ》头版限量编号[WAV+CUE]
- 李健《无时无刻》[WAV+CUE][590M]
- 陈奕迅《酝酿》[WAV分轨][502M]
- 卓依婷《化蝶》2CD[WAV+CUE][1.1G]
- 群星《吉他王(黑胶CD)》[WAV+CUE]
- 齐秦《穿乐(穿越)》[WAV+CUE]
- 发烧珍品《数位CD音响测试-动向效果(九)》【WAV+CUE】
- 邝美云《邝美云精装歌集》[DSF][1.6G]
- 吕方《爱一回伤一回》[WAV+CUE][454M]