Automate Reports

Question ID: 104349

We use QTP10. Is there a way generate or convert a report to HTML or PDF etc, from the cmdline.

Right now we call automation from the cmd line and drive all scripts via excel.

I want to create my own reporting dashboard or summary of each script. I know how to get pass/fail status but not the info or failure where the test actually failed.

So if a report failed I want to send a email and attach the report… I just need the reporting part and I’ll be able to do this.

Is this possible.

Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on April 1, 2011 3:39 pm
Answers (1)
Private answer

Have you thought about using the FileSystemObject to create a report? You can use it to create a file of your choosing, and issue write statements at any point in the test. For example:

Set FSO = CreateObject(''Scripting.FileSystemObject'')
Set reportFile = FSO.CreateTextFile(''C:my_report.txt'',True)
'The file extension type can be changed to another format if needed, such as a .doc
'and the True flag indicates that the file can be overwritten if it already exists

'Now that you have the file object initialized, you would use the WriteLine method to write
'whatever data you want at various points in your script like in this conditional:

If Window(''Test App'').WinEdit(''Username:).Exist Then
reportFile.WriteLine ''The username object is displayed.''
reportFile.WriteLine ''ERROR: The username object is not displayed.''
End If

'And you could also write status messages at various points:

reportFile.WriteLine ''Test Step: Logout Attempt...''

'When done with the writing, we need to close the file to commit the changes and save it:


'and release the FileSystemObject from memory:

Set FSO = Nothing

Marked as spam
Posted by (Questions: 2, Answers: 477)
Answered on April 4, 2013 7:39 pm