Programmatically Change "load extension" Command Line parameter

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: webpagetest/runtest.php at master · WPO-Foundation/webpagetest · GitHub

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! :slight_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).