随笔分类 -  自动化测试

1
摘要:引用链接:http://reverocean.iteye.com/blog/14899571. describe和context describe和context方法用来组织相关的行为example。使用一个字符串作为他们的参数,以及使用一个block来定义其上下文的范围。写model的spec或者其他的unit test时,可以传一个Ruby类作为describe的第一个参数。Doing so also creates an implicit subject for the examples.describe Timesheet do ……enddescribe可以嵌套一般使用:descri 阅读全文
posted @ 2013-08-16 14:23 dami.van 阅读(1131) 评论(0) 推荐(0)
摘要:解决方法gem install selenium-webdriver -v='2.34.0' 阅读全文
posted @ 2013-08-16 13:27 dami.van 阅读(449) 评论(0) 推荐(0)
摘要:1.安装NppExec 插件2.按快捷键F6,在弹出框中输入如下命令:npp_save cd "$(CURRENT_DIRECTORY)" jruby "$(FILE_NAME)" 3.save保存命令后,点击点击ok开始执行 阅读全文
posted @ 2013-08-14 18:23 dami.van 阅读(435) 评论(0) 推荐(0)
摘要:引用链接:https://github.com/cucumber/cucumber/wiki/HooksHooksCucumber provides a number of hooks which allow us to run blocks at various points in the Cucumber test cycle. You can put them in your support/env.rb file or any other file under the support directory, for example in a file called support/hoo 阅读全文
posted @ 2013-08-08 18:05 dami.van 阅读(751) 评论(0) 推荐(0)
摘要:引用链接:http://cukes.info/step-definitions.htmlData TablesData Tables are handy for specifying a larger piece of data:Given the following users exist: | name | email | phone | | Aslak | aslak@email.com | 123 | | Matt | matt@email.com | 234 | | Joe | joe@email.org | 456 | Just... 阅读全文
posted @ 2013-08-07 17:08 dami.van 阅读(4165) 评论(0) 推荐(0)
摘要:引用链接:https://github.com/cucumber/cucumber/wiki/Scenario-Outlinesscript/cucumber--i18nzh-CN|feature|"功能"||background|"背景"||scenario|"场景"||scenario_outline|"场景大纲"||examples|"例子"||given|"*","假如"||when|"*","当"||the 阅读全文
posted @ 2013-08-07 17:07 dami.van 阅读(1153) 评论(0) 推荐(0)
摘要:引用链接:http://watirmelon.com/2011/01/24/composition-or-inheritance-for-delegating-page-methods/Composition or inheritance for delegating pagemethods?Posted on January 24, 2011The thing I like to do when creating a page object pattern for automated web testing is delegating any methods that don’t belon 阅读全文
posted @ 2013-08-06 16:02 dami.van 阅读(250) 评论(0) 推荐(0)
摘要:在cucumber的自动化测试框架下面,在一个steps文件中定义的@page对象,可以在其他的不同的steps文件中调用,在整个的场景生命周期中都是有效的原因:cucumber开始执行时,一次性把所有的steps文件都加入到了内存中,所以...会出现这种现象 阅读全文
posted @ 2013-08-05 16:06 dami.van 阅读(270) 评论(2) 推荐(0)
摘要:1.sort → new_ary click to toggle sourcesort { |a, b| block } → new_aryReturns a new array created by sorting self.Comparisons for the sort will be done using the operator or using an optional code block.The block must implement a comparison between a and b, and return -1, when a follows b, 0 when a. 阅读全文
posted @ 2013-07-29 12:18 dami.van 阅读(9995) 评论(0) 推荐(0)
摘要:http://rubydoc.info/gems/watir-webdriver/frameshttp://rdoc.info/gems/watir-webdriver/frameshttp://www.ruby-doc.org/core-2.0/Array.html 阅读全文
posted @ 2013-07-27 01:16 dami.van 阅读(204) 评论(0) 推荐(0)
摘要:引用链接:http://www.cnblogs.com/timsheng/archive/2012/12/10/2812164.htmlCucumber是Ruby世界的BDD框架,开发人员主要与两类文件打交 到,Feature文件和相应的Step文件。Feature文件是以 feature为后缀名的文件,以Given-When-Then的方式描述了系统的场景(scenarios)行为;Step文件为普通的Ruby文 件,Feature文件中的每个Given/When/Then步骤在Step文件中都有对应的Ruby执行代码,两类文件通过正则表达式相关联。笔者在 用Cucumber+Watir做回 阅读全文
posted @ 2013-07-23 13:29 dami.van 阅读(1247) 评论(0) 推荐(0)
摘要:背景是公用的,每个场景都会执行,相当于前提条件;场景是一个单独的case别人的cucumber学习总结:链接:http://ruby-china.org/topics/7119 阅读全文
posted @ 2013-07-23 13:19 dami.van 阅读(521) 评论(0) 推荐(0)
摘要:1.http://code.google.com/p/chromedriver/downloads/list 下载chromedriver驱动文件chromedriver.exe2.把驱动文件放在chrome的安装目录默认的安装目录如下:C:\Documents and Settings\Administrator\Local Settings\Application Data\Google\Chrome\Application3.在系统环境变量的path中添加:C:\Documents and Settings\Administrator\Local Settings\Application 阅读全文
posted @ 2013-07-03 17:24 dami.van 阅读(358) 评论(0) 推荐(0)
摘要:1.安装java运行时环境,且配置环境变量2.安装jruby环境,建议选择安装1.6.8或1.6.7版本的3.安装需要的gem包gem install activerecord -v='3.0.5'gem install activerecord-jdbc-adapter -v='1.1.3'gem install arel -v='2.2.1'gem install color -v='1.4.1'gem install cucumber -v='1.2.1'gem install i18n -v='0. 阅读全文
posted @ 2013-07-03 16:51 dami.van 阅读(541) 评论(0) 推荐(0)
摘要:1.在jruby版本1.6.7中,报异常:not such file to load --watir-webdriver解决方法 :在文件的首行添加:require 'rubygems' # jruby 1.7.3中不需要添加2.执行自动化中报异常:Selenium::WebDriver::Error::WebDriverError: unable to obtain stable firefox connection in 60 seconds解决方法: geminstallselenium-webdriver3.异常报错:[WARNING] MultiJson is usi 阅读全文
posted @ 2013-07-03 13:19 dami.van 阅读(384) 评论(0) 推荐(0)
摘要:引用链接:http://kongqingyun123.blog.163.com/blog/static/6377283520134158437813/Cucumber是BDD(行为驱动开发)中成熟的一个框架,官方网址: http://cukes.info/1、cucumber安装1、安装ruby2、gem install cucumber 安装cucumber2、cucumber介绍cucumber是一种可以使用文本描述语言来执行自动测试用例的工具,使用的语言叫做Gherkin.Gherkin用于描述软件的行为而不需要了解具体的实现,的使用主要有两个目的文档和自动测试用例(我们希望能够和手工测 阅读全文
posted @ 2013-07-03 09:57 dami.van 阅读(6555) 评论(0) 推荐(0)
摘要:引用链接:http://www.51testing.com/html/44/n-813944.html原文如下:最近通过各种渠道发现大家对一些测试工具的基本情况不太清楚,经常会问类似于watir与watir webdriver的区别,我有1个项目,是用watir还是用selenium webdriver呢,之类的问题,在这里笔者不才略微总结一下,希望能给大家一个较为清晰的认识。 Waitr与Watir-WebDriver有什么区别? Watir是非常优秀的一款自动化测试工具。其使用ruby作为脚本语言进行开发,能够在ie上实现元素定位、操作等自动化任务; Watir WebDriver是... 阅读全文
posted @ 2012-06-25 13:43 dami.van 阅读(957) 评论(0) 推荐(0)
摘要:很好的自动化学习资料 Ruby watir seleniumhttp://bbs.51testing.com/thread-278944-1-1.html 阅读全文
posted @ 2012-06-15 17:03 dami.van 阅读(163) 评论(0) 推荐(0)
摘要:http://dtrex.iteye.com/ 阅读全文
posted @ 2012-06-07 18:07 dami.van 阅读(139) 评论(0) 推荐(0)
摘要:Gem介绍:Gem是一个管理Ruby库和程序的标准包,它通过Ruby Gem(如 http://rubygems.org/ )源来查找、安装、升级和卸载软件包,非常的便捷。Ruby 1.9.2版本默认已安装Ruby Gem,如果你使用其它发行版本,请参考“如何安装Ruby Gem”。Ruby gem包的安装方式:所有的gem包,会被安装到 /[Ruby root]/lib/ruby/gems/[ver]/ 目录下,这其中包括了Cache、doc、gems、specifications 4个目录,cache下放置下载的原生gem包,gems下则放置的是解压过的gem包。当安装过程中遇到问题时,可 阅读全文
posted @ 2012-06-06 10:30 dami.van 阅读(1067) 评论(0) 推荐(0)

1