cucumber+Firewatir环境搭建

简介:
应他人需求搭建故事驱动,黄瓜的Ruby自动化测试环境,特总结如下: 
1.安装Ruby  1.8.7运行环境,exe文件一键安装 
2.在XP上会在C盘默认创建Ruby相关文件,安装时选中将Ruby作为该机器的环境变量 
3.安装完ruby后,ruby自带Gem套件,使用Gem套件安装Firewatir,命令为gem install xxx 
4.安装Firewatir成功后,可以运行Firewatir的脚本了,这个时候如果Firewatir不运行的话,可以使用webdriver版得watir来调用你的Firefox,这样Watir脚本既可以执行了 
5.安装cucumber黄瓜,gem install cucumber安装黄瓜的时候可能会需要Json或者其他gem文件需要你提前安装 
5.5安装kit-dev+Json,安装Kit后将Kit的所有Bin目录放置到环境变量里。然后运行gem install json 
6.cucumber  xxxx.featrue即可运行你的黄瓜脚本 
6.5.提示错误require,安装web-driver,命令为gem install watir-webdriver 
6.5.1 提示require错误 安装rspec,命令为gem install rspec,此时能打开浏览器,然后再提示没有jssh,安装jssh
6.5.2 用虚拟机重试的时候,能启动浏览器但不能运行我的测试脚本,怀疑可能性为该网址内容--http://www.natontesting.com/2009/07/24/firewatir-jssh-unable-to-connect-fixed/该部分将会在下次使用时,敲定 
7.运行时结果不是彩色的,会提示你安装ansicon,则你到http://adoxa.110mb.com/ansicon/网站去下载ansicon 
8.
1. Download and unzip the file from http://adoxa.110mb.com/ansicon
2. open cmd and navigate to the unzipped folder
3. Navigate to x64 (if you have a 64 bit machine) otherwise navigate to x86
4. Type ansicon.exe -h and you will get the following:
D:\Data\ansicon\x86>ansicon.exe -h
ANSICON by Jason Hood .
Version 1.32 (22 December, 2010).  Freeware.
http://ansicon.adoxa.cjb.net/

Process ANSI escape sequences in Win32 console programs.

ansicon -i|I | -u|U
ansicon [-m[]] [-p | -e|E string | -t|T [file(s)] | program [args]]

  -i            install - add ANSICON to the AutoRun entry (implies -p)
  -u            uninstall - remove ANSICON from the AutoRun entry
  -I -U         use local machine instead of current user
  -m            use grey on black ("monochrome") or  as default color
  -p            hook into the parent process
  -e            echo string
  -E            echo string, don't append newline
  -t            display files ("-" for stdin), combined as a single stream
  -T            display files, name first, blank line before and after
  program       run the specified program
  nothing       run a new command processor, or display stdin if redirected

 is one or two hexadecimal digits; please use "COLOR /?" for details.
5. Execute 'ansicon.exe -i' to install and add ansicon to your Windows
6. Run your cucumber 0.10.0 test and you should 
get the coloured output result on Windows

这步做完你的故事驱动测试就可以开始了,哦,有可能你会需要一些黄瓜的脚本范例,那么去黄瓜的官网上去找,是可以下载的。网址为:http://cukes.info/
目录
相关文章
|
18天前
|
jenkins 测试技术 持续交付
pytest教程-1-环境搭建
Pytest是Python的一种单元测试框架,与Python自带的unittest测试框架类似,但是比 unittest框架使用起来更简洁,效率更高。
|
11月前
|
JSON Linux 数据格式
Hugo教程#1配置开发环境
前段时间我把我的博客的生成器从Jekyll换到了Gatsby后来发现并不好用,又想回到Jekyll,最后由于ruby的gem安装老是出错,所以我试了一下Hugo
150 0
|
11月前
|
数据可视化 机器人 测试技术
自动化测试 RobotFramework安装以及使用教程
自动化测试 RobotFramework安装以及使用教程
|
Python Windows
pytest 框架环境搭建
pytest 框架环境搭建
355 0
|
JSON 测试技术 Linux
【HttpRunner v3.x】笔记 ——1. 环境安装
【HttpRunner v3.x】笔记 ——1. 环境安装
【HttpRunner v3.x】笔记 ——1. 环境安装
|
自然语言处理 测试技术 数据库
|
机器人 程序员 测试技术
RobotFramework环境搭建
RobotFramework环境搭建
RobotFramework环境搭建
|
JavaScript Java 测试技术
App自动化测试之Appium环境搭建
Appium是一个开源、跨平台的测试框架,可以用来测试原生及混合的移动端应用。Appium支持IOS、Android及FirefoxOS平台。
App自动化测试之Appium环境搭建
|
机器人 jenkins 测试技术
RobotFramework基础篇-环境搭建
Robotframework(通常简称RF,在下文中都将用RF代替)是一个关键字驱动的自动化测试框架,底层是基于Python语言实现的。
RobotFramework基础篇-环境搭建
|
Android开发 Python Windows
Python编程:两步完成eclipse安装Python开发环境
Python编程:两步完成eclipse安装Python开发环境
152 0
Python编程:两步完成eclipse安装Python开发环境