How to execute the webpagetest script using API

Hi Patric,

I am facing an issue while executing the webpagetest script(more than one script line) using API.

I have developed the WPT script for our scenario and the script like as…

setValue name’proxyUsername xxxxx
setValue name’proxyPassword xxxx
clickAndWait name’loginSubmit

I am using HTTP Requester for posting the request to API, for single script line i am using parameter “script” with value as “” and working fine. But in my script i have more script line as mentioned above.

How can we pass this entire script to the API. I have tired by passing ALL script lines to the “script” parameter but no luck. Please help us on how to execute WPT script having multiple commands (navigate, setValue, ClickAndWait) etc.


Hi Pmeenan,

Did you get a chance to look into the below issue? I am unable to execute WPT script using API.


Handled offline (I think) but in case anyone else bumps into it. You need to make sure to urlencode the script when you send it up to the API. You can urlencode the whole thing, newlines and all.

Thank you very much Patric for the help. The problem is for URL encoding is not done for new line and due to that we got error message, after providing the url encoded value to me, i have executed it and successfully got the results. Thanks for your quick support.