In
Qtp10
Medium,
Reporter
Object has some improvements,
Reportevent
A parameter"
Imagefilepath
". The following is a function prototype description:
Reporter. reportevent
Eventstatus
,Reportstepname
,Details
[,Imagefilepath
]
Argument
|
Type
|
Description
|
Eventstatus
|
Number or pre-defined constant
|
Status of the test results step:
0
OrMicpass: Causes the status of this step to be Passed and sends the specified message to the test results window.
1
OrMicfail: Causes the status of this step to be Failed and sends the specified message to the test results window. When this Step runs, the test fails.
2
OrMicdone: Sends a message to the test results Window without affecting the pass/fail status of the test.
3
OrMicwarning: Sends a warning message to Test results window, but does not cause the test to stop running, and does not Affect the pass/fail status of the test.
|
Reportstepname
|
String
|
Name of the Step displayed in The test results window.
|
Details
|
String
|
Description of the test results Event. The string will be displayed in the step details frame in the test Results window.
|
Imagefilepath
|
String
|
Optional
. Path and filename of the image to be displayed in Results details Tab Of the test results window. Images in Following formats can be displayed: BMP, PNG, JPEG, and GIF.
Notes:
Images cannot be loaded from Quality Center .
Including large images in the test results may Impact performance.
If an image is specified as a relative path, Quicktest will first search the results folder for the image and then The search paths specified inFolders Pane of the options Dialog box.
|
In this way, you can add information in the test step report, for example:
Browser ("Browser"). Page ("webpage"). Image ("mylogo"). capturebitmap ("mylogo.bmp ")
Reporter. reportevent micdone,
"Display logo", "This is My logo", "mylogo.bmp"
When an error is encountered, you should take a look at the current screen to analyze and locate the cause of the error when you view the test log later, as shown in the following code:
Validation1 = browser ("Web
Tours "). Page (" Web
Tours "). Frame (" navbar "). Image (" login "). exist (0)
If validation1
Then
Reporter. reportevent micpass,"
Login object exists "," the login object exists"
Else
Desktop. capturebitmap
"Fail.png", true
Reporter. reportevent
Micfail, "the login object
Exists "," the login object doesn' t exists "," fail.png"
End if
'...
Validation2 =
Browser ("Web tours"). Page ("Web
Tours "). Frame (" navbar "). Image (" signoff
Button "). exist (0)
If validation2
Then
Reporter. reportevent micpass, "the logout
Object exists "," The logout object exists"
Else
Desktop. capturebitmap
"Fail.png", true
Reporter. reportevent
Micfail, "the logout object
Exists "," The logout object doesn' t exists "," fail.png"
End if