易截截图软件、单文件、免安装、纯绿色、仅160KB

Ruby watir 测试框架

转自 http://www.advidea.cn/biancheng/200943135232.html 
Ruby watir 测试框架
大多数人都会安装 ruby,
也通过Ruby 安装 gem,
也安装了ruby IDE开发工具:netbeans,
但就是不能跑watir环境,狂晕加吐中。。。
错误如下:
in `require': no such file to load -- watir (LoadError)
反正就是找不到watir,这里为大家献上终极解决方案:
1。首先安装:ruby186-26.exe
下载地址:http://www.ruby-lang.org/zh_CN/downloads/
选择Windows 系统的 Ruby 1.8.6 一步安装 
下载并安装就OK。
2。安装开发工具:netbeans.
因为netbeans是基于JAVA的,所以需要先下载一个JAVA JDK。
下载地址:自己google里去搜一下: JAVA JDK 下载。下载1.5版本以上就OK。
3。下载netbeans.并安装:
很简单,下载地址:
http://www.netbeans.info/downloads/dev.php  右边栏直接点续续按钮,
选择第一个,然后进入下面页面
http://bits.netbeans.org/download/trunk/nightly/2009-03-17_02-01-11/
选择支持ruby的IDE选项,然后下载就可以了。
安装完毕后,进菜单Tools -> Update Center
点Next,等所有可升级模块出来后,找到Ruby文件夹,点选到需要更新的模块中(一共会有九个文件被选择)
按指令完成更新,重启NetBeans。
4。OK啦。现在就差GEM了。
网络上介绍了N多种方法,就是不管用。
这里提供个完美版本:点击下载 ruby watir gem 安装包 advidea.rar
下载后解压直接运行:
advidea.bat 文件,即可完成安装 ruby watir 自动化框架。
5。OK啦,现在开始 Ruby 开发工具 netbeans:
新建一个ruby application,直接完成。
在main.rb里输入:
   require 'watir'
   test_site = 'http://www.advidea.cn/'
 
   # open the IE browser
   ie = Watir::IE.new
   # print some comments
   puts "## Beginning of test: advidea"
   puts "  "
 
   puts "Step 1: go to the test site: " + test_site
   ie.goto(test_site)
   puts "  Action: entered " + test_site + " in the address bar."
然后直接运行试一下?
没有效果。会出现找不到 watir 提示
我们选中右边栏新建的Ruby 项目右键属性,
运行标签下:Ruby 平台选择我们自己的,而非内置的。保存。
然后再运行一


相关文档:

转载——Ruby字符串处理

转自:http://developer.51cto.com/art/200912/170762.htm 
Ruby字符串处理函数总结列表分享
Ruby字符串处理函数包括返回字符串长度函数;判断字符串中是否包含另一个串函数;字符串插入;字符串分隔,默认分隔符为空格等等。
 
str.length => integer 
str.include? other_str
&nbs ......

21本经典ruby rails电子书


Beginning Ruby from Novice To Perfessional

Head First Rails

Agile Web Development with Rails 3rd Edition(new)

Agile Web Development with Rails 3rd Edition

Agile Web Development with Rails 3rd Editio ......

phpRPC + Ruby + Arduino = 远程控制

phpRPC + Ruby + Arduino = 遠程控制LED開關(?)
嗯,我知道這是個很無聊的Sample :P
關於phpRPC與Arduino請自行Google
觀看此demo之前請先安裝另外一篇所提到的serialport
與另外一個Gem
套件:phprpc
在這個ļ ......

Ruby声音


转 Adding Sound to Your Ruby Apps
Have you ever thought about including sounds in your Ruby application? Used sparingly, sound may enhance your applications by adding audio cues or a custom touch. You could, for example, play a beep or chime that announces the completion of a lengthy process. Per ......

Ruby的self

self上下文
     Ruby的self有和Java的this相似之处,但又大不相同。Java的方法都是在实例方法中引用,所以this一般都是指向当前对象的。而Ruby的代码逐行执行,所以在不同的上下文(context)self就有了不同的含义,先来看看常见的context self都代表哪些
1
2
3
4
5
6
7
8
9
10
11
12
13 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号