Forum Discussion

BMD's avatar
BMD
Contributor
10 years ago

Picture.SaveToClipboard

Team,
I have a script that opens excel and saves a file generated from the AUT, to a network drive and then closes excel to use the DDT function I have below.

function ReadExcelHeaderFile(PathFileName, TargetText, TargetCell)
//Search for column header text in an Excel at a known column number
//Argument (path and filename, text to search for, column number)
{
  DDT.ExcelDriver((PathFileName), "Sheet1");
    if ( (TargetText) == (DDT.CurrentDriver.ColumnName(TargetCell)) )

After I run through the above DDT compares I want to log that all pass. But the problem is excel is closed so I can’t add the active window or an image of excel before it was closed and excel most be closed to run the DDT function.

 

 

I like to record the pass with a picture of the application running and a message. Log.Picture(Sys.Desktop.ActiveWindow(), "AR2 PASS - The”);

 

I was going to save the picture/image to the clipboard of excel running, as outlined in the help below.

Pict=(Sys.Desktop.ActiveWindow());

---help file-----
Description
The Picture.SaveToClipboard method lets you save the image represented by the Picture object to the Clipboard in order to paste the image somewhere else later.
Note that you can also copy the image to the clipboard by assigning the corresponding Picture object to the Sys.Clipboard property.
--------
My question is how do I save an image of excel running and after I complete all the DDT checks and it passes I can log the pass with the image of excel that is now closed?  The help is not helping.

 

TC=10.30

Browser=firefox 24.3

ScriptLanguage=JScript

Thanks for any pointers.

BMD

No RepliesBe the first to reply