Can we add screen shot (pictures) to a folder on C drive while running test script
I need to take screen shots during execution of our test scripts and save these screen shots (aka picture) in different folders on hard drive. I have tried the Sys.Desktop.Picture(x,y,w,h) method to take the picture but I can't find a method to allow me to save
it on hard drive in specific folder. I can however, do :
Regions.AddPicture(mypic,"Step_1_Pic");
or
Log.AddPicture(mypic,"Step_1_Pic");
is there a way to put these pictures in a folder on C drive, for example, C:\myTestPics\
thanks
I think I figured it ....here is how I did it and it works for what I need to do :
var filepath = "C:\\PicsLib\\f1";
var filepicName = "dpicfile.png";
//add pic
var picname = "mypic1";
var rpic = Sys.Desktop.Picture(10,10,1900,1001);
Regions.AddPicture(rpic,picname);
var rpicFullname = filepath+"\\"+filepicName;
var picObj = Regions.GetPicture(picname);
if( picObj ){
picObj.SaveToFile(rpicFullname);
}