Reporter object of qtp10

Source: Internet
Author: User

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

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.