Copy and paste to and from the Clipboard during a run session in QTP

You can use the Clipboard object to copy, cut, and paste text during a QuickTest run session.
The Clipboard object supports the same methods as the Clipboard object available in Visual Basic, such as:
•    Clear
•    GetData
•    GetText
•    SetData
•    SetText
For more information on these methods, see http://msdn.microsoft.com/en-us/library/ms172962.aspx.
Below is an example of Clipboard object usage:
Set MyClipboard = CreateObject(“Mercury.Clipboard”)
MyClipboard.Clear
MyClipboard.SetText “TEST”
MsgBox MyClipboard.GetText

Advertisements