0

I have a server side script which accepts form input and logs in to Testopia (Bugzilla plug-in) and gets a CSV describing a certain test run using:

Mech->get("<...>/tr_list_caseruns.cgi?ctype=csv&run_id=xxxxx", ":content-file" => "result.csv");

The browser link is some javascript that exports the CSV by setting window.location to this url. Manually clicking the link in the browser will download the full CSV, however getting the link using mechanize will only download the first 25 records (typing the url into browser prompts download and only gets the first 25 as well). Link is of the form:

text: 'Export Results to CSV',
icon: 'extensions/Testopia/img/csv.png',
iconCls: 'img_button_16x',
handler: function(){
window.location = 'tr_list_caseruns.cgi?ctype=csv&run_id=' + run.run_id;

(In an Ext.menu.Menu)

Is there a good way to do this? Even the difference between typing the url and clicking the link would be useful. Thanks.

-Kevin

1
  • try setting the referer header
    – stu42j
    Sep 11, 2012 at 20:42

1 Answer 1

0

Use "Live HTTP Headers" or "FireBug" or some such add-on to get a request that works and one that doesn't. Then, start adding the headers from the one that works until you find which one the server wants.

1
  • Some javascript requests don't show in Live HTTP Headers, but they do show when traced with FireBug, but Live HTTP Headers is a good start.
    – runrig
    Sep 11, 2012 at 23:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.