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

2 thoughts on “Copy and paste to and from the Clipboard during a run session in QTP

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s