当测试失败时,我无法弄清楚如何捕获屏幕截图。请任何帮助/示例?
这是我的代码示例
testName = "Entered 000000 - Invalid Unit Number"
browser.text_field(:name => 'unitNumber').set '000000'
browser.button(:name => "OpRetrieve").click
message=browser.text_field(:id => 'messages').text
if message == "Invalid Unit Number"
f1.puts "PASSED #" + testId.to_s + ": " + testName
else
f1.puts "FAILED #" + testId.to_s + ": " + testName + ". Message: " + message
"Capturd screenshot"
end
testId=testId+1