How to read and correlate PDF content by Loadrunner Vugen

541 views
Skip to first unread message

Priya

unread,
Oct 1, 2015, 8:37:49 PM10/1/15
to LoadRunner
Hello All,

In one of the requirement for load test script , I need to read content of the PDF getting generated in one of the step and save one specific code present in  PDF. This value will be later used in next request as input.
I am able to save the PDF and generate txt format of the same. But I am not able to read txt file and fetch this specific value from the same.

Could you please help.

Regards
Priya

James Pulley

unread,
Oct 1, 2015, 8:50:10 PM10/1/15
to LoadRunner
Leverage your core foundation skills in 'C' Programming.  See example for fopen() and related functions dealing with file i/o.   As you will be involving the disk directly in your test you will need to heavily monitor the health of the load generator because with tens/dozens/hundreds fighting for arbitrated access to the read/write head on the drive your disk can readily become a bottleneck for the performance of your entire load generator.   This is the same reason that data files are read into ram at the beginning of a test and that the recommendation is to minimize logging.   CPU-DISK-MEMORY-NETWORK.  Heavily involve disk or network for your internal housekeeping and you can kill a load generator quite easily.

A PDF is a specialized type of TEXT file.  Do not take my work for it.  Open one up in Notepad and take a look.  It is nothing more than a Structured postscript program/document.   If you are fortunate enough to have your values clearly visible inside of the PDF doc then nothing prevents you from correlating for the value directly out of the PDF stream/download without having to resort to downloading a document to a disk (which you would have to correlate for and write out to disk in the first place).

James Pulley
NewCOE/LioadRunnerByTheHour/LiteSquare/PerfBytes

Mital Majmundar

unread,
Oct 2, 2015, 9:09:34 AM10/2/15
to LR-Loa...@googlegroups.com

First off, I dont think you would be able to read the specific value from PDF. A pdf is just a snapshot of the text document contents. Its not meant to be read.

Another point is that you need to figure out a way to get that value in pdf from the server. Obviously if its written in pdf it should be in the backend somewhere.

Also do consider to split the flow in 2. I.e reading the values first and then using in your next script. Because from performance testing point of view you should not make your local as a botte neck.

--
You received this message because you are subscribed to the Google Groups "LoadRunner" group.
To unsubscribe from this group and stop receiving emails from it, send an email to LR-LoadRunne...@googlegroups.com.
To post to this group, send email to LR-Loa...@googlegroups.com.
Visit this group at http://groups.google.com/group/LR-LoadRunner.
To view this discussion on the web visit https://groups.google.com/d/msgid/LR-LoadRunner/4228eba3-a8c6-4133-a0a8-5e280ab5f481%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Priyanka Tiwari

unread,
Oct 2, 2015, 12:27:10 PM10/2/15
to LR-Loa...@googlegroups.com
Hi All,

thanks for your inputs.

The dynamic value i am trying to fetch from the PDF is a random number which generated and kept in the user session. This value is not present in any request/response but is kept in the session and is stored at the end of the flow. Hence I have to read the PDF and fetch this information.

Can you please suggest if there is any way to read the user session/objects at the browser.

Regards
Priyanka

Message has been deleted

Yathish Kumar

unread,
Oct 3, 2015, 10:09:52 AM10/3/15
to LR-Loa...@googlegroups.com

Why can't you do string traverse or string manipulation in the whole pdf response to capture the intended value, so you no need to save that into file,

Or else please paste the response and the value you are looking to capture

On 02-Oct-2015 11:27 pm, "Priya" <priya9...@gmail.com> wrote:
Hi All,

thanks for your inputs.

The dynamic value i am trying to fetch from the PDF is a random number which generated and kept in the user session. This value is not present in any request/response but is kept in the session and is stored at the end of the flow. Hence I have to read the PDF and fetch this information.

Can you please suggest if there is any way to read the user session/objects at the browser.

Regards
Priyanka

--
You received this message because you are subscribed to the Google Groups "LoadRunner" group.
To unsubscribe from this group and stop receiving emails from it, send an email to LR-LoadRunne...@googlegroups.com.
To post to this group, send email to LR-Loa...@googlegroups.com.
Visit this group at http://groups.google.com/group/LR-LoadRunner.

James Pulley

unread,
Oct 3, 2015, 10:09:52 AM10/3/15
to LoadRunner
Have you tried opening the PDF in notepad and searching for the string in question to see what the left and right boundary markers would be?


On Friday, October 2, 2015 at 12:27:10 PM UTC-4, Priya wrote:
Hi All,

thanks for your inputs.

The dynamic value i am trying to fetch from the PDF is a random number which generated and kept in the user session. This value is not present in any request/response but is kept in the session and is stored at the end of the flow. Hence I have to read the PDF and fetch this information.

Can you please suggest if there is any way to read the user session/objects at the browser.

Regards
Priyanka
On Fri, Oct 2, 2015 at 2:32 PM, Mital Majmundar <mital.m...@gmail.com> wrote:

First off, I dont think you would be able to read the specific value from PDF. A pdf is just a snapshot of the text document contents. Its not meant to be read.

Another point is that you need to figure out a way to get that value in pdf from the server. Obviously if its written in pdf it should be in the backend somewhere.

Also do consider to split the flow in 2. I.e reading the values first and then using in your next script. Because from performance testing point of view you should not make your local as a botte neck.

On 02 Oct 2015 2:37 AM, "Priya" <priya9...@gmail.com> wrote:
Hello All,

In one of the requirement for load test script , I need to read content of the PDF getting generated in one of the step and save one specific code present in  PDF. This value will be later used in next request as input.
I am able to save the PDF and generate txt format of the same. But I am not able to read txt file and fetch this specific value from the same.

Could you please help.

Regards
Priya

--
You received this message because you are subscribed to the Google Groups "LoadRunner" group.
To unsubscribe from this group and stop receiving emails from it, send an email to LR-LoadRunner+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "LoadRunner" group.
To unsubscribe from this group and stop receiving emails from it, send an email to LR-LoadRunner+unsubscribe@googlegroups.com.

To post to this group, send email to LR-Loa...@googlegroups.com.
Visit this group at http://groups.google.com/group/LR-LoadRunner.

André Luyer

unread,
Oct 3, 2015, 10:09:52 AM10/3/15
to LoadRunner
As mentioned before, open the PDF in a text editor like Notepad.

If you can find the "user session" as plain text then you are lucky and can capture it using web_reg_save_param.

But the text you are looking for can also be encoded as a hex string. For example <48656C6C6F>Tj decodes as "Hello" (assuming a simple font is used and no CMAP). Again you can use web_reg_save_param to capture the hex string, but a small conversion code is needed to convert it into a C-string (sscanf in a loop).

In a PDF the text can also be compressed using ZLIB. It is possible to extract such text without the need to write it to file first, but that's more complicated, see: http://h30499.www3.hp.com/t5/LoadRunner-Support-Forum/Converting-BodyBinary-to-Readable-Format/td-p/5764725

The link to the PDF specification:

André

Priya

unread,
Oct 7, 2015, 9:33:12 AM10/7/15
to LoadRunner
Hello All,

I tried opening the PDF in a notepad and I am not able to read data since output is in binary. Part of that data is mentioned below , and the whole data is a big string like this.

Ç@Ve\Ú¸,æÙl³‚Õí«Ý;1Á\x15R„ó`


I checked possibility of using trueclient in firefox/IE10 but this application is not supported but any of those browsers. It can support only IE6 which is not supported by Trueclient.

Regards
Priyanka

Kevyland

unread,
Oct 9, 2015, 11:34:37 AM10/9/15
to LoadRunner

aravind sai kuchibhatla

unread,
Oct 9, 2015, 2:46:42 PM10/9/15
to LR-Loa...@googlegroups.com
Hi Priya,

Go through below link:


It will be useful for you.

Regards
Aravind.

--
You received this message because you are subscribed to the Google Groups "LoadRunner" group.
To unsubscribe from this group and stop receiving emails from it, send an email to LR-LoadRunne...@googlegroups.com.
To post to this group, send email to LR-Loa...@googlegroups.com.
Visit this group at http://groups.google.com/group/LR-LoadRunner.
Reply all
Reply to author
Forward
0 new messages