ReplayType is QTP Web Add-in setting. It can be used to change how the events are replayed on the browser. There are two modes of ReplayType
- Events (1) – Replay of events using the Browser methods (something similar to DOM).
- Mouse (2) – Replay of events using the mouse and keyboard simulation.
When to change ReplayType?
Use of ReplayType can be best explained by a below example. In below sample textbox we need to type in any value and see that the button gets enabled when there some text in the textbox and disabled when there is not text. Click on the button will display the values inside the textbox.
importance:
For few of the objects, though the objects reference available and able to recognize in applications and perform script execution without any issues, it doesn't perform expected action in the application.
Example: There is button in the application Object is available in Object Repository and we are able to highlight it During script execution, it executes without any issue but on clicking button it is able to move to next screen(in fact it is not clicking on button).
In order to handle such issues, UFT has an option use ReplayType which will change the execution with mouse/keyboard control(this means similar to manually taking control with hand), Below line of the script can be used for this.
Setting.WebPackage("ReplayType") = 2
If you want to change it again then below line of script can be used.
Setting.WebPackage("ReplayType") = 1
Example: There is button in the application Object is available in Object Repository and we are able to highlight it During script execution, it executes without any issue but on clicking button it is able to move to next screen(in fact it is not clicking on button).
In order to handle such issues, UFT has an option use ReplayType which will change the execution with mouse/keyboard control(this means similar to manually taking control with hand), Below line of the script can be used for this.
Setting.WebPackage("ReplayType") = 2
If you want to change it again then below line of script can be used.
Setting.WebPackage("ReplayType") = 1
Example:
Setting.WebPackage("ReplayType") = 2
Browser("google").Page("google").WebEdit("txtReplayType").Set "Knowledge"
Browser("google").Page("google").WebButton("Type and enable me").Click
Setting.WebPackage("ReplayType") = 1