自动化测试工具有很多,包括开源的和商业的,以下介绍目前比较流行的开源自动化测试工具。
Selenium是一个用于Web应用程序自动化测试的开源测试框架。Selenium是个庞大的家族,包含Selenium IDE、Selenium Server、Selenium Core、Selenium WebDriver、Selenium RC(Remote Control)、Selenium Grid、Selenium on Rails等。
| #encoding: utf-8 | |
| require 'spreadsheet' | |
| require 'rexml/document' | |
| include REXML | |
| class Generator | |
| attr_accessor :dataResult #array,获取每个xml所需数据 | |
| attr_accessor :resultPath #string,生成的xml存储路径 | |
| attr_accessor :excelPath #string,excel文件路径 | |
| attr_accessor :templatePath #string,xml模板文件路径 |
| #encoding: utf-8 | |
| require 'open-uri' | |
| require 'net/http' | |
| require 'net/ssh' | |
| require 'net/scp' | |
| require 'nokogiri-pretty' | |
| require 'rexml/document' | |
| include REXML |
| # one dimensional array | |
| # yield | |
| class Array | |
| def my_map | |
| arr = [] | |
| each {|n,i| arr << yield(n)} | |
| arr | |
| end | |
| end |
| # className & methodName are both String | |
| # Object.send | |
| def dynamic(className, methodName, *param) | |
| k = Kernel.const_get(className).new() | |
| k.send(methodName, *param) if k.respond_to? methodName | |
| end | |
| # Object.method | |
| def dynamic(className, methodName, *param) |
$ rhc app create -a [appname] -t diy-0.1
$ rhc cartridge add -a [appname] -c mysql-5.1