- ubuntu12.04环境下使用kvm ioctl接口实现最简单的虚拟机
- Ubuntu 通过无线网络安装Ubuntu Server启动系统后连接无线网络的方法
- 在Ubuntu上搭建网桥的方法
- ubuntu 虚拟机上网方式及相关配置详解
CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界.
这篇CFSDN的博客文章基于Python在MacOS上安装robotframework-ride由作者收集整理,如果你对这篇文章有兴趣,记得点赞哟.
robotframework是一个框架,是一个可以用于关键字测试驱动的框架。而ride(robotframework-ride)就是可以使得写robot测试用例更加方便快捷的ide图形操作工具.
安装 。
因为是基于python的,所以其可以运行在多个操作系统上。这里主要介绍一下ride在macos上的使用方式.
os版本 。
macos版本:10.13.2 。
wxpython 。
由于ride是基于wxpython的应用,所以首先需要保证wxpython已经得到了安装。安装命令如下:
安装命令:brew install wxpython 。
安装日志 。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
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
/
cellar
/
gdbm
/
1.15
:
19
files,
569.8kb
=
=
> installing wxpython dependency: readline
=
=
> downloading https:
/
/
homebrew.bintray.com
/
bottles
/
readline
-
7.0
.
3_1
.high_sierra.bottle.tar.gz
######################################################################## 100.0%
=
=
> pouring readline
-
7.0
.
3_1
.high_sierra.bottle.tar.gz
=
=
> caveats
this formula
is
keg
-
only, which means it was
not
symlinked into
/
usr
/
local,
because macos provides the bsd libedit library, which shadows libreadline.
in
order to prevent conflicts when programs look
for
libreadline we are
defaulting this gnu readline installation to keg
-
only.
for
compilers to find this software you may need to
set
:
ldflags:
-
l
/
usr
/
local
/
opt
/
readline
/
lib
cppflags:
-
i
/
usr
/
local
/
opt
/
readline
/
include
=
=
> summary
?
/
usr
/
local
/
cellar
/
readline
/
7.0
.
3_1
:
46
files,
1.5mb
=
=
> installing wxpython dependency: sqlite
=
=
> downloading https:
/
/
homebrew.bintray.com
/
bottles
/
sqlite
-
3.24
.
0.high_sierra
.bottle.tar.gz
######################################################################## 100.0%
=
=
> pouring sqlite
-
3.24
.
0.high_sierra
.bottle.tar.gz
=
=
> caveats
this formula
is
keg
-
only, which means it was
not
symlinked into
/
usr
/
local,
because macos provides an older sqlite3.
if
you need to have this software first
in
your path run:
echo
'export path="/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
?
/
usr
/
local
/
cellar
/
sqlite
/
3.24
.
0
:
11
files,
3.5mb
=
=
> installing wxpython dependency: python@
2
=
=
> downloading https:
/
/
homebrew.bintray.com
/
bottles
/
python@
2
-
2.7
.
15_1
.high_sierra.bottle.tar.gz
######################################################################## 100.0%
=
=
> pouring python@
2
-
2.7
.
15_1
.high_sierra.bottle.tar.gz
=
=
>
/
usr
/
local
/
cellar
/
python@
2
/
2.7
.
15_1
/
bin
/
python
-
s setup.py
-
-
no
-
user
-
cfg install
-
-
force
-
-
verbose
-
-
single
-
version
-
externally
-
mana
=
=
>
/
usr
/
local
/
cellar
/
python@
2
/
2.7
.
15_1
/
bin
/
python
-
s setup.py
-
-
no
-
user
-
cfg install
-
-
force
-
-
verbose
-
-
single
-
version
-
externally
-
mana
=
=
>
/
usr
/
local
/
cellar
/
python@
2
/
2.7
.
15_1
/
bin
/
python
-
s setup.py
-
-
no
-
user
-
cfg install
-
-
force
-
-
verbose
-
-
single
-
version
-
externally
-
mana
=
=
> caveats
pip
and
setuptools have been installed. to update them
pip install
-
-
upgrade pip setuptools
you can install python packages with
pip install <package>
they will install into the site
-
package directory
/
usr
/
local
/
lib
/
python2.
7
/
site
-
packages
see: https:
/
/
docs.brew.sh
/
homebrew
-
and
-
python
=
=
> summary
?
/
usr
/
local
/
cellar
/
python@
2
/
2.7
.
15_1
:
4
,
673
files,
82.8mb
=
=
> installing wxpython dependency: jpeg
=
=
> downloading https:
/
/
homebrew.bintray.com
/
bottles
/
jpeg
-
9c
.high_sierra.bottle.tar.gz
curl: (
6
) could
not
resolve host: akamai.bintray.com
error: failed to download resource
"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
?
/
usr
/
local
/
cellar
/
jpeg
/
9c
:
21
files,
749.8kb
, built
in
33
seconds
=
=
> installing wxpython dependency: libpng
=
=
> downloading https:
/
/
homebrew.bintray.com
/
bottles
/
libpng
-
1.6
.
34.high_sierra
.bottle.tar.gz
curl: (
6
) could
not
resolve host: akamai.bintray.com
error: failed to download resource
"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
?
/
usr
/
local
/
cellar
/
libpng
/
1.6
.
34
:
26
files,
1.2mb
, built
in
1
minute
38
seconds
=
=
> installing wxpython dependency: libtiff
=
=
> downloading https:
/
/
homebrew.bintray.com
/
bottles
/
libtiff
-
4.0
.
9_3
.high_sierra.bottle.tar.gz
curl: (
6
) could
not
resolve host: akamai.bintray.com
error: failed to download resource
"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
?
/
usr
/
local
/
cellar
/
libtiff
/
4.0
.
9_3
:
246
files,
3.5mb
, built
in
5
minutes
10
seconds
=
=
> installing wxpython dependency: wxmac
=
=
> downloading https:
/
/
homebrew.bintray.com
/
bottles
/
wxmac
-
3.0
.
4.high_sierra
.bottle.tar.gz
######################################################################## 100.0%
=
=
> pouring wxmac
-
3.0
.
4.high_sierra
.bottle.tar.gz
?
/
usr
/
local
/
cellar
/
wxmac
/
3.0
.
4
:
810
files,
23.7mb
=
=
> installing wxpython
=
=
> downloading https:
/
/
homebrew.bintray.com
/
bottles
/
wxpython
-
3.0
.
2.0_1
.high_sierra.bottle.tar.gz
######################################################################## 100.0%
=
=
> pouring wxpython
-
3.0
.
2.0_1
.high_sierra.bottle.tar.gz
?
/
usr
/
local
/
cellar
/
wxpython
/
3.0
.
2.0_1
:
1
,
108
files,
37.9mb
liumiaocn:~ liumiao$
|
版本确认 。
1
2
3
4
5
6
7
8
9
10
|
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
✔, wxmac ✔
liumiaocn:~ liumiao$
|
暂定对应1:wxpython安装之后,目前的版本还缺少一个软连接才能正常动作,根据日志可以看到此次安装的wxpython版本为wxpython-3.0.2.0_1, 按照如下操作创建软连接即可 。
创建链接 。
1
2
3
4
5
6
|
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$
|
确认方式 。
1
2
3
4
5
|
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,当前版本出现了如下错误信息 。
1
2
3
4
5
|
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$
|
原因确认:经过定位代码中错误出现的位置,确认到如下文件:
1
2
3
4
5
6
7
8
|
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:直接将支持的版本号修改为当前的版本 。
1
2
3
4
5
6
7
|
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 。
1
2
3
4
|
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$
|
实际上在如下行添加了对当前版本的支持 。
1
2
3
4
5
6
7
8
|
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的安装 。
1
2
3
4
5
6
7
8
9
10
11
|
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进行安装 。
1
2
3
4
5
6
7
|
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,已经可以正常动作了.
总结 。
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对我的支持。如果你想了解更多相关内容请查看下面相关链接 。
原文链接:https://blog.csdn.net/liumiaocn/article/details/80739206 。
最后此篇关于基于Python在MacOS上安装robotframework-ride的文章就讲到这里了,如果你想了解更多关于基于Python在MacOS上安装robotframework-ride的内容请搜索CFSDN的文章或继续浏览相关文章,希望大家以后支持我的博客! 。
有人可以解释我如何使用与数据驱动测试用例相关的可选关键字参数的默认值吗? 正如您在我的示例中看到的,在某些情况下并非所有默认值都被使用: *** Test Cases *** | testArgs |
我正在尝试做这个练习 http://www.uitestingplayground.com/progressbar当进度条达到 75% 时,我想按下一个按钮。 这是我的代码 Open Browser
我想用 Screen Should Contain 或 Screen Should Not Contain 替换 ${assertion_Keyword} 所以我想像关键字一样放置参数 check_e
如何循环遍历 Robot Framework 中的文件内容? 我的文件内容是这样的: 1001 1002 1003 1004 我想一一读取内容,将其分配给一个变量,然后对其进行一些操作。 最佳答案 R
我有一个 RF 测试,我需要打印变量值,而不是名称。 我正在尝试使用“ log to console Num: ${Num} ”,但 log.html 只显示: **KEYWORD** BuiltIn
如何将消息记录到 Robot 框架中的控制台,当我使用 log 关键字时,它会记录到报告文件中。请指教。 最佳答案 BuiltIn library 有一个名为 Log to console 的关键字这
假设我的源代码中有以下 HTML: ... some text ... 假设我通过以下方式找到了这个元素: ... ${web_element} Get Webelement id:myEleme
我无法在 Robot 框架中使用 sudo 命令,因为无法使用关键字“Run Process”输入密码。我们必须使用哪个关键字来做到这一点? PS:在我的项目中无法以 root 身份连接,因为此帐户已
从几天开始,我一直在尝试安装 robotframework RIDE,我尝试按照我在谷歌上搜索到的所有帖子进行操作,但仍然面临一些问题。以下是我遵循并得出的结论: 我已经成功安装了 python2.7
我们如何使用 Set Variable if带一个关键字,其中 Keyword 返回一个需要在 RobotFramework 中设置的变量. 例如:${Var} = set variable if $
我正在使用 python 使用 Robot Framework Selenium。我需要帮助来获取字符串的特定部分,而无需获取外部库。假设文字说“您的产品范围价格从 0 美元到 400 美元”,所以我
#我需要为通过案例生成随机测试字符串,对于失败案例我需要通过 excel 文件给出手动值 #我试过了: #Give input to new bill cycle [Arguments] ${C
我正在探索使用 Robot Framework 在 Python 中编写单元测试。我们目前有一些使用 pytest 开发的预先存在的单元测试。单元测试使用 mock.patch 方法模拟某些功能(例如
我用这个: ${today}= Get Time ${today_formated}= Convert Date ${today} result_format=%d 结果是 01,表示该月的第
例子: Log To Console This is the first argument This is the second argument This is the third ar
我有一条线: ${http_proxy}= Remove String %{HTTP_PROXY} http:// 在我的 test.txt for robot framework 无论环境变量
尝试验证元素是否包含特定文本,但关键字 Element Should Contain 找不到文本,即使我在 xpath 属性中明确输入它包含文本也是如此。但是关键字 Wait Until Page C
嗨,如果某个 bool 值为假,我想运行一个关键字,如果 Bool 为真,我这样做是为了运行一个关键字,但是如果 Bool 为假,我如何运行该关键字 Run Keyword If ${Bool}
在机器人框架测试用例中,我设置了一个变量,然后执行了一个过程。 因为变量的设置不是一个非常有趣的信息,我不想在我的报告中包含它。 | Verifying STUFF | | | ${endpoint
我无法在机器人框架中检查数据类型。我想评估变量的数据类型。 例如 ${variable} 123 现在我需要检查 ${variable}这里的值是否为整数。我尝试使用评估,但它提供了数据结构。
我是一名优秀的程序员,十分优秀!