In our application (Web based application)we will get a pdf
file and we have check a particular text in that pdf. Can
any one tell how to check text in a pdf file.
In the same pdf file it generating some links and I have to
click that links. QTP unable recognizing that links, even
id did record and playback qtp does not generating any
script.
Can any one help me….?
Answer Posted / nanda
Hi...we should have add in for it. but with add in also we
do it..by copieng pdf test to a text file.
for this...
string1 = "nanda"
len_data = len(string1)
i=0
file_path = "C:\Documents and Settings\Madhu
Sudhan\Desktop\pdftotext.text"
Set clipboard = createobject("mercury.clipboard")
Set fso = createobject("scripting.filesystemobject")
Set notepad = fso.createtextfile(file_path,8)
'*********Start recording click on Edit menu--select all,
'click on Edit menu--copy, click on pdf file to get deselect
'the text...************
Window("Adobe Reader").Activate
Window("Adobe Reader").WinMenu("Menu").Select "Edit;<Item 8>"
Window("Adobe Reader").WinMenu("Menu").Select "Edit;<Item 4>"
Window("Adobe Reader").Activate
get_text = clipboard.gettext
notepad.write get_text
notepad.close
set notepad = fso.opentextfile(file_path,1)
do while notepad.AtEndofStream <> true
get_data = notepad.readline
search_data = instr(get_data, "nanda")
capture_data = mid(get_data,search_data,len_data))
if capture_data = string1 then
i = i+1
else
end if
loop
msgbox "the text is found in "& i" rows"
for any queries...
nanda.dreddy@gmail.com
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
How to execute the WR Script through QTP? I have WinRunner script with initialization script, common scripts, GUI AND functions. I connected WR through QTP with "call to WinRunner" option but I am getting problem after connecting to WinRunner i.e. showing "Do you want to quit now" with 'yes' and 'No' message box
how to evalute defects in QTP script?
what is the difference between modular framework & datadriven framework
Did the scripts need lot of maintenance? If yes, why?
how can we test the Triggers, Cursors, Indexes while doing Database testing in DTP??
When I click on a link in web page.Link should open in new window.can anyone please let me know the script for this ---Koti
how to acess a test in RSA?
What is different command used in command Prompt while using QTP?
What are the different types of qtp test assets and their extensions?
What are the five challenges you faced in QTP?
How to get Traceability matrix from TD?
How many types of actions are there in quicktest professional (qtp)?
Can launch two instances of qtp on the same machine?
How do you do batch testing in wr and is it possible to do in qtp, if so explain?
Create flight reservation login descriptive programing (Condition: Remove the value and substitute with a variable, and then call the validation from Excel) Plz help me....... very urgent.........