I came across Good question ..... Write a script to only
download pdf's if there are 20 links on a page. Kindly reply
these type of questions are pretty challenging..
Answer Posted / arun kumar
just try using the below code may be it helps you.
long fp;
char *data;
unsigned long prmLen;
web_url("example.html",
"URL=http://www.trainingg.com/example.html",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
//Truncate to zero length or create file for writing.
fp = fopen("c:\\temp\\my_file.pdf","wb");
//Set the parameter size large enough to save the data.
web_set_max_html_param_len("200000");
//Use web_reg_save_param with the correct boundary to
capture the data returned by the server.
web_reg_save_param
("FILED","LB=","RB=","Search=Body",LAST);
web_url("PDF",
"URL= http://www.trainingg.com/example/automate.pdf",
"TargetFrame=",
"Resource=0",
"RecContentType=application/pdf",
"Referer= http://www.trainingg.com/example.html",
"Snapshot=t2.inf",
"Mode=HTML",
LAST);
//Get the download size.
lr_eval_string_ext("{FILED}", strlen("{FILED}"), &data,
&prmLen, 0, 0, -1);
//Write the data saved to an output file.
fwrite(data, prmLen, 1, fp);
//Close the file pointer.
fclose(fp);
Is This Answer Correct ? | 0 Yes | 6 No |
Post New Answer View All Answers
How to import a test case present in ".xls" file to TD under a Test set?
Can testing be done on the production system, or will a separate test system be required? How are browser caching, variations in browser option settings, dial-up connection variabilities, and real-world internet 'traffic congestion' problems to be accounted for in testing?
how to convert 100 into hundred repees only and viceversa
Can any one tell me about "Mapping Repository Parameter Values" and why we use it....??How to use it???Please, tell the preconditions also...........???? Thanks in Advance
How extensive or customized are the server logging and reporting requirements; are they considered an integral part of the system and do they require testing?
How can i initiate the objects to find uniquely in OR
when u script reveiwing in which area u more concentrates?
What are parameterizing tests?
How would you export a script from one pc to another in qtp?
How are cgi programs, applets, javascripts, ActiveX components, etc. to be maintained, tracked, controlled, and tested?
If there is a change in the object type eg: A button is changed as link, 1. How to edit that in the shared object repository. 2.What options are available to edit the object within shared object repository other than copy from loca; 3.What would be the effect of the change in Coded Scripts within QTP and Functions stored in .vbs file which are loaded and used in QTP
Can anyone share/send me QTP 8.2 Crack as I had it before but now it's virus affected. Pls send me on Sawale.vijay@gmail.com Thanks, ~Vijay
I am in .Net development for past 3.5 years and want to enter in to automated testing and learn QTP. For this I need some good tutorial for beginners. I will be really greatful if any one has and they can send it to me on this address- ruchidureja@gmail.com
How does QTP identify an object?
What is qtpro? What is quick test pro? What is a quick test professional?