1. Prevent machine locking while script execution in QTP
- Set deviceReplay = CreateObject("Mercury.DeviceReplay")
- deviceReplay.MouseMove 0,0 //OR abs_x + 10, abs_y + 10
- deviceReplay.PressKey 28 //optional
- Set deviceReplay = Nothing
Also used this object, we can perform Mouse/Keyboard operations if Set/Type not supported in QTP. Refer this.
2. Produce HTML log
a. Close the QTP.
b. Modify the below key value by opening Registry Editor in your machine.
HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\QuickTest Professional\Logger\Media\Log
c. Change DWord Active value as 1 insteadof 0.
d. Now open QTP and execute your scripts. You will find a new folder Log under your results folder.
e. You can use the HTML log present under Log folder to send via mail to anybody.
3. Disable unwanted log events from your log.
You can use Reporter.Filter to restrict default events on log. You can use Filter property to log the events which are logged by yourself using Reporter.ReportEvent and want to avoid entries which are logged by QTP itself like below,
4. DescribeResult(Err.Number)
DescribeResult(Err.Number) in QTP - Just displays Err.Description value
c. Change DWord Active value as 1 insteadof 0.
d. Now open QTP and execute your scripts. You will find a new folder Log under your results folder.
e. You can use the HTML log present under Log folder to send via mail to anybody.
3. Disable unwanted log events from your log.
You can use Reporter.Filter to restrict default events on log. You can use Filter property to log the events which are logged by yourself using Reporter.ReportEvent and want to avoid entries which are logged by QTP itself like below,
- Reporter.Filter = rfEnableAll 'Enables all type of logging
- Reporter.ReportEvent micPass, "Step1", "opened my page"
- Reporter.Filter = rfDisableAll 'Disables all type of logging
4. DescribeResult(Err.Number)
DescribeResult(Err.Number) in QTP - Just displays Err.Description value
Comments
Post a Comment