require 'watir'
require 'test/unit'
require 'watir/screen_capture'
include Watir::ScreenCapture#要求一定要安装Autoit
class TC_Screen < Test::Unit::TestCase
def test_a_Screen
file_name= "123.jpg"
screen_capture(file_name,false,false)#就是这句话,false是全屏截图。
puts File.expand_path(__FILE__)
puts File.expand_path(file_name)
assert((file_name))
end
end
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9934490/viewspace-972667/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/9934490/viewspace-972667/