Watch Our YouTube Channel
It is currently Wed Nov 22, 2017 1:45 am
 

All times are UTC



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon Apr 30, 2012 11:55 am 
Offline

Joined: Mon Apr 30, 2012 11:43 am
Posts: 2
after each test script runs in qtp, i would like to see the test script execution status as a baloon tool tip under system tray with the following:

1. NUmber of test cases run
2. test cases remaining
3. test cases passed
4. test cases failed.


Top
 Profile  
Reply with quote  
PostPosted: Tue May 15, 2012 7:01 am 
Offline

Joined: Mon Apr 30, 2012 11:43 am
Posts: 2
i found a solution too..

Dim sicon_Path, iCounter
' sicon_Path includes the path where the .ico image is located. Copy the image from the Data folder and map it accordingly under path defined below.
sicon_Path="C:\Documents and Settings\Admin\My Documents\My Pictures\ico.ico"

Set objNtfy=DotNetFactory.CreateInstance("System.Windows.Forms.NotifyIcon","System.Windows.Forms")
Set objToolTip =DotNetFactory.CreateInstance("System.Windows.Forms.ToolTipIcon","System.Windows.Forms")
Set objIcon=DotNetFactory.CreateInstance("System.Drawing.Icon","System.Drawing",sicon_Path)
Set objFSO = CreateObject("Scripting.FileSystemObject")

If not objFSO.FileExists(MONITOR_FILEPATH) Then
objFSO.CreateTextFile (MONITOR_FILEPATH)
End If

Redim preserve Textattrlist(3)
iCounter = 0

'OpenTextFile Method needs a Const value
' ForAppending = 8 ForReading = 1, ForWriting = 2

Set objTextFile = objFSO.OpenTextFile(MONITOR_FILEPATH, FOR_READING, True)

Do Until objTextFile.AtEndOfStream
Textattrlist(iCounter) = Cint(objTextFile.ReadLine)
iCounter = iCounter + 1
Loop
If Reporter.RunStatus=micpass then
sTemppass= Textattrlist(1)+1
sTempfail=Textattrlist(2)
Else
sTempfail=Textattrlist(2)+1
sTemppass=Textattrlist(1)
End IF

Set objTextFileWrite = objFSO.OpenTextFile(MONITOR_FILEPATH, FOR_WRITING, True)
objTextFileWrite.writeline(Textattrlist(0))
objTextFileWrite.writeline(sTemppass)
objTextFileWrite.writeline(sTempfail)
objTextFileWrite.Close


Set objTextFile1 = objFSO.OpenTextFile (MONITOR_FILEPATH, FOR_READING, True)
objNtfy.Icon=objIcon
objNtfy.BalloonTipIcon=objToolTip.Info
objNtfy.Visible=True
objNtfy.Text = "Results Info" 'Balloon Tool Tip Text Name
objNtfy.BalloonTipTitle = "Results Execution Status" 'Balloon Tool Tip Title
objNtfy.BalloonTipText=objTextFile1.ReadAll
objNtfy.ShowBalloonTip(WAIT_MONITOR) ' Tool tip is displayed for 6 seconds
wait(WAIT_MONITOR)
objNtfy.Dispose()

' Return status message
If Err Then
Reporter.ReportEvent micFail, "Error:" &Err.Number&":"&Err.Description&""
Err.Clear
Else
End If

' Restore default error handling
Set objNtfy= Nothing
Set objToolTip = Nothing
Set objIcon= Nothing
Set objFSO = Nothing
On Error Goto 0

End Sub


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron