Thursday, April 18, 2013

Capturing and attaching screenshot for failed step


The below code capture screenshot and places the file in a specific location.

fCnt is a public variables to be declared in function library and initialized to 0

Public function capture_scrshot
       fCnt=fCnt+1
    desktop.CaptureBitmap"d:\Screenshots\" & fCnt & ".png",True
    capture_scrshot="d:\Screenshots\" & fCnt & ".png"
end  Function


This file can be attached to the failed step by calling this function as below

reporter.ReportEvent  micFail,"Step description","Step details",capture_scrshot

Best practices for test automation in agile software development

  Agile software development is a highly iterative and collaborative approach to software development that emphasizes flexibility and a...