So the OnLog event works for Log.Error wherever in the script. What if we want to generate event on the errors logged by test complete (the ones that occurred for any reason such as object not found etc.). These errors are also displayed as red x in the test log. rraghvani
Also, I am completely lost here. I need to get access to the child data Picture. I found the below code. The documentation tells to use PictureLogDataObj.Picture property to get access to the Picture data, but I think I am using indexes incorrectly. I also tried giving 1,2 in Data object but it throws error. Could you check the attachment and help where I am making the mistake. I am not able to get to the child data set and save Picture.
function LogDataTypeExample()
{
Log.Error("testing")
// Obtains a collection of logs
var LogsCol = Project.Logs;
// Obtains the first log item
var LogItem = LogsCol.LogItem(0);
// Obtains the first dataset
// of the specified log item
var LogData = LogItem.Data(0);
// Obtains the scheme of the dataset
var Sch = LogData.Scheme.Child(0); //it picks up 'ldtText ' but if I change Child(1) it throws error that parameters are incorrect.
// Obtains the data type of the first dataset
var LogDataType = Sch.DataType;
// Checks the data type
if ( LogDataType == ldtTable )
Log.Message("The dataset contains tabular data or data in a tree-like list.");
else
if ( LogDataType == ldtText )
Log.Message("The dataset contains text data.");
else
Log.Message("The dataset contains pictures.");
}