Interview Questions   Tutorials   Discussions   Programs   Videos   

QTP - What is mercury clipboard in qtp? Where we can get this in qtp tool ?

asked marvit August 21, 2014 06:15 AM  

What is mercury clipboard in qtp? Where we can get this in qtp tool ?


1 Answers

answered By Dharma   0  
mercury.clipboard" is method to create a clipboard
object. and use to copy and paste the text.

The below Example will copy the text from PDF file to
notepad file:

note : the given files paths are in my local system. Please
give paths in ur local system.

Set clipboard = createobject("mercury.clipboard")

'Give notepad file path according to ur local system path.

filepath = "C:\Documents and Settings\Madhu
for_reading = 1
for_appending = 8

'Please Open any pdf file in ur system. at the time of
running it should be opened and in maximize.

Window("Adobe Reader").WinMenu("Menu").Select "Edit;<Item 8>"
Window("Adobe Reader").WinMenu("Menu").Select "Edit;<Item 4>"

Set fso = createobject("scripting.filesystemobject")

Set notepad = fso.createtextfile(filepath,for_appending)

nanda = clipboard.gettext
notepad.write nanda


Set notepad = fso.opentextfile(filepath,for_reading)

msgbox reading
   add comment

Your answer

Join with account you already have



Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!