WebPagetest Forums

Full Version: Programmatically Change "load extension" Command Line parameter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I'm trying to use the wpt_batch program on my private instance to load webpages in succession while changing the extensions.

I was able to add another extension to the browser by editing the config file on my private instance however, when I attempt to do this by passing the --load-extension in the 'cmdline' option of test_params I get an "Invalid command line option" error response.

Is it possible to change the extensions loaded on the page programmatically?
I would be interested in this feature too.
Try adding load-extension to the list of command-line options that are allowed special characters in runtest.php: https://github.com/WPO-Foundation/webpag....php#L2491

You might just stub out the validation call to let everything through but it's risky in that it opens up remote access to people running arbitrary commands on your test agents (unless you can also figure out a regex that you can filter for loading that doesn't have the same risk).
(03-03-2017 06:40 AM)pmeenan Wrote: [ -> ]Try adding load-extension to the list of command-line options that are allowed special characters in runtest.php: https://github.com/WPO-Foundation/webpag....php#L2491

You might just stub out the validation call to let everything through but it's risky in that it opens up remote access to people running arbitrary commands on your test agents (unless you can also figure out a regex that you can filter for loading that doesn't have the same risk).


Thank you!! I got it working by editing runTest.php in a similar fashion to what you said. Didn't think this through entirely and have another question: Is there a way to differentiate tests with different extensions from the test results (json, xml, har)? Currently looking and will post if I find a solution, but any ideas would be very helpful! Smile
Easiest/best way would probably be to make the command-line options available in the test result (or if you added it as a discrete option, make that option available in the result).
Reference URL's