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 do the scripting. Are there any inbuilt functions in QTP? What is the difference between them? How to handle script issues?
What are the features of quick test pro(qtp)?
requirement is for combo box your expected value is str= "Denver.Frankfurt.London.Los Angeles.Paris.Portland.San Francisco.Seattle.Sydney.Zurich" you must get the text in combo box and need to compare them how
Is it possible to merge two object repository files in qtp?
How to use debug tools?
Where you get the run time data table?
Without using gui map editor we can recognize the application in winrunner ?
How to save your test using quicktest professional?
What is quick test pro?
What are the advantages of qtp?
Define virtual object?
What is the difference between run time object and test object?
how to disable the pop ups through QTP using a script
After executing the script in qtp suppose i found some script execute successfully and found some error.So how to report the status for both (i.e pass and fail report)in test director. For "fail" We use "defect tab" in testdirector. But for "pass" how to report it to TL.what is the process plz anybody ans
How is the Bitmap checkpoint different from Image checkpoint?