注意:本文内容是以“在Window7系统中安装本地RobotFrmamework自动化测试环境”为例。

Robot Framework简介

Robot Framework documentation:http://robotframework.org/robotframework/
  • Robot Framework 是一款基于 Python 的功能自动化测试框架;
  • 具备良好的可扩展性,支持关键字驱动,可以同时测试多种类型的客户端或者接口,可以进行分布式测试执行;
  • 可用于验收测试和验收测试驱动开发(ATDD);

安装RIDE

安装顺序:Python ---> setuptools & pip ---> Robot Framewok ---> wxPython(v2.8.12.1) ---> RIDE

1-安装Python并设置环境变量

>python --version
Python 2.7.12 >
>pip list
pip (8.1.1)
setuptools (20.10.1)

环境变量 PYTHONPATH: C:\Python27\;C:\Python27\Lib\site-packages;C:\Python27\Scripts

建议执行“python -m pip install --upgrade pip ”升级pip。

2-安装robotframework

根据需要搜索并下载对应源码的压缩包(.tar.gz或.zip),解压后,切换到对应目录,运行:python setup.py install即可安装.

>pybot --version
Robot Framework 3.0 (Python 2.7.12 on win32)

3-安装wxPython

wxPython2.8-win64-unicode-2.8.12.1-py27.exe
 
4-安装robotframework-ride
>ride.py  # 启动RIDE

5-确认已完成所有安装

>pip list
pip (8.1.2)
robotframework (3.0)
robotframework-ride (1.5.2.1)
setuptools (20.10.1)
>

安装SSH访问库

安装顺序:

  1. PyCrypto
  2. ecdsa 
  3. paramiko
  4. robotframework-sshlibrary

确认所有安装包

>pip list
ecdsa (0.13)
paramiko (1.14.0)
pip (8.1.2)
pycrypto (2.6)
robotframework (3.0)
robotframework-ride (1.5.2.1)
robotframework-sshlibrary (2.1.2)
setuptools (20.10.1)
>

验证

>python
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import SSHLibrary
>>>
>>> ssh = SSHLibrary.SSHLibrary()
>>> ssh.open_connection("10.92.111.76", "22")
1
>>> ssh.login("root", "arthur")
u'Last login: Wed Aug 17 12:32:25 2016 from 10.141.98.107\r\r\n[root@clab395node01 ~]# '
>>> print ssh.execute_command("whoami")
root
>>>

安装Oracle

1 - Oracle Instant Client

Oracle Instant Client provides Oracle access and allows you to run your applications without installing the standard Oracle client.

Since Oracle Instant Client is composed of basic instant client  and the sdk instant client ,   thus two of them should be installed.

Unzip the packages(both instantclient-basic and instantclient-sdk) into a single directory such as "instantclient", in this instruction, the Oracle Instant Client's folder structure looks like:

To set environment variable, open environment variables setting,

new a system variable named ORACLE_HOME, set its value with the Oracle  Instant Client installation path and  append ORACLE_HOME to path. See:

C:\Users\guowli>set ORACLE_HOME
ORACLE_HOME=C:\instantclient C:\Users\guowli>
C:\Users\guowli>set path
Path=C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\RSA SecurID Token Common;C:\WINDOWS\system32;C:\WINDOWS;
C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\WebEx\Productivity Tools;C:\
Program Files (x86)\Sennheiser\SoftphoneSDK\;C:\Program Files (x86)\SafeCom\SafeComPrintClient;C:\Program Files\Tortoise
SVN\bin;C:\Python27;C:\Python27\Scripts;C:\Python27\Lib\site-packages;C:\Program Files\Java\jdk1.8.0_101\bin;C:\Program
Files\Java\jdk1.8.0_101\jre\bin;C:\instantclient
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC C:\Users\guowli>

2 - cx_Oracle

cx_Oracle is a Python extension module that allows access to Oracle databases and conforms to the Python database API specification.

3 - SQLAlchemy

SQLAlchemy is Python library that allows database connections directly from Python code, helps in handling results and also allows using Python's/SQLAlchemys's own exception handling. It could be compared in JAVA's jdbc library.

确认所有安装包:

>pip list
cx-Oracle (5.1.2)
ecdsa (0.13)
paramiko (1.14.0)
pip (8.1.2)
pycrypto (2.6)
robotframework (3.0)
robotframework-ride (1.5.2.1)
robotframework-sshlibrary (2.1.2)
setuptools (20.10.1)
sqlalchemy (0.5.6)
>

验证

>python
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import sqlalchemy
>>>
>>> host="10.92.111.76"
>>> port="1521"
>>> database="oss"
>>>
>>> connect_str = "oracle://omc:omc@" + str(host) + ":" + str(port) + "/" + str(database)
>>> engine = sqlalchemy.create_engine(connect_str, echo=False)
>>> c = engine.connect()
>>>
>>> result = c.execute("select owner,object_type from all_objects where object_name='FM_ALARM'").fetchall()
>>>
>>> print result
[('PUBLIC', 'SYNONYM'), ('FM', 'VIEW')]
>>>

安装Selenium库

SeleniumLibrary is a  Robot Framework  test library that uses the popular  Selenium  web testing tool internally.

It provides a powerful combination of simple test data syntax and support for  different browsers .

Web testing TA cases requires SeleniumLibrary.

安装顺序:
  1. decorator
  2. Selenium
  3. robotframework-selenium2library
  4. IEDriverServer - (optional, for IE explorer)

确认所有安装包:

>pip list
cx-Oracle (5.1.2)
decorator (4.0.10)
ecdsa (0.13)
paramiko (1.14.0)
pip (8.1.2)
pycrypto (2.6)
robotframework (3.0)
robotframework-ride (1.5.2.1)
robotframework-selenium2library (1.7.4)
robotframework-sshlibrary (2.1.2)
selenium (2.53.2)
setuptools (20.10.1)
sqlalchemy (0.5.6)
>

Robot Framework - 建立本地测试环境的更多相关文章

  1. https,https的本地测试环境搭建,asp.net结合https的代码实现,http网站转换成https网站之后遇到的问题

    一:什么是https SSL(Security   Socket   Layer)全称是加密套接字协议层,它位于HTTP协议层和TCP协议层之间,用于建立用户与服务器之间的加密通信,确保所传递信息的安 ...

  2. 【转】https,https的本地测试环境搭建,asp.net结合https的代码实现,http网站转换成https网站之后遇到的问题

    正需要这个,写的很好,就转过来了 转自: http://www.cnblogs.com/naniannayue/ 一:什么是https SSL(Security   Socket   Layer)全称 ...

  3. 用java开发微信公众号:测试公众号与本地测试环境搭建(一)

    本文为原创,原始地址为:http://www.cnblogs.com/fengzheng/p/5023678.html 俗话说,工欲善其事,必先利其器.要做微信公众号开发,两样东西不可少,那就是要有一 ...

  4. Robot Framework - 2 - 创建测试库

    04- 创建测试库--基础概念 Robot Framework 实际的测试能力是由测试库提供的. ***** 支持的编程语言 Robot Framework 自身是用 Python 编写的,能使用 P ...

  5. MapReduce两种执行环境介绍:本地测试环境,服务器环境

    本地测试环境(windows):1.在windows下配置hadoop的环境变量2.拷贝debug工具(winutils.exe)到hadoop目录中的bin目录,注意winutils.exe的版本要 ...

  6. 利用Docker Compose快速搭建本地测试环境

    前言 Compose是一个定义和运行多个Docker应用的工具,用一个YAML(dockder-compose.yml)文件就能配置我们的应用.然后用一个简单命令就能启动所有的服务.Compose编排 ...

  7. Robot Framework + Selenium library + IEDriver环境搭建

    转载:https://www.cnblogs.com/Ming8006/p/4998492.html#c.d 目录: 1 安装文件准备2 Robot框架结构3 环境搭建  3.1 安装Python  ...

  8. Robot Framework(1)——环境搭建及安装

    一.了解Robot Framework Robot Framework不是一个测试工具,准确来说,它是一个自动化测试框架,或者说它是一个自动化测试平台 特性如下: 1.支持关键字驱动.数据驱动和行为驱 ...

  9. win10系统iis下部署搭建https (ssl/tls)本地测试环境

    有时想要把公司的某些XX项目部署成https站点,是为了在传输层加密传输,防止他人嗅探站点重要数据信息,平常我们使用的http方式都是明文方式传输的很不安全,容易被他人窃取.而有些时候要在本地搭建ht ...

随机推荐

  1. OO第二单元单元总结

    总述 OO的第二单元主题是电梯调度,与第一单元注重对数据的输入输出的处理.性能的优化不同,第二单元的重心更多的是在线程安全与线程通信上.这此次单元实验之前,我并未对线程有过了解,更谈不上“使用经验”, ...

  2. 七、PyQT5控件——QSlider,QSpinBox

    一.Qslider QSlider是一个滑动条,可以设置成水平或垂直放置.最常用的方法允许用户在某一范围内互动该滑块,并将滑块的位置转换成一个整数值(int类型),这种方式可以在某一个范围内平顺的变动 ...

  3. elasticdump 方法迁移数据

    elasticdump -rm -ti taskrabbit/elasticsearch-dump --ignore-errors=true --offset=1000  --input=http:/ ...

  4. String Match

    Finding length of longest common substring /*Finding length of longest common substring using DP * * ...

  5. Java:Map总结

    概要 学完了Map的全部内容,我们再回头开开Map的框架图. 本章内容包括:第1部分 Map概括第2部分 HashMap和Hashtable异同第3部分 HashMap和WeakHashMap异同 转 ...

  6. php final

    final:如果父类中的方法被声明为final,则子类无法覆盖该方法.如果一个类被声明为final,则不能被继承. 方法示例: <?phpclass BaseClass {   public f ...

  7. python实现异步调用函数

    import time from concurrent.futures import ThreadPoolExecutor def RunBenchmark(url): print('GET %s' ...

  8. Notes on Distributed System -- Distributed Hash Table Based On Chord

    task: 基于Chord实现一个Hash Table 我负责写Node,队友写SuperNode和Client.总体参考paper[Stoica et al., 2001]上的伪代码 FindSuc ...

  9. 二叉树/DFS总结

    二叉搜索树(Binary Search Tree,又名排序二叉树,二叉查找树,通常简写为BST)定义如下: 空树或是具有下列性质的二叉树: ()若左子树不空,则左子树上所有节点值均小于或等于它的根节点 ...

  10. git撤销commit 并保存之前的修改

    撤销并保留修改 参数 –soft  # 先进行commit ,之后后悔啦  $ git commit -am "对首篇报告研究员字段改为author_name" 执行git log ...