MyBB Internal: One or more warnings occured. Please contact your administrator for assistance.
WebPagetest Forums - Differences between running a test through the API and the site

WebPagetest Forums

Full Version: Differences between running a test through the API and the site
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

I was expecting that the 2 scenarios below would give exactly the same results, but they don't:

Senario 1:
Make a GET request like this:

Result 1:

Senario 2:
Run the script from home page:
Result 2:

The difference is console output is missing under the screen shot screen when the test is run through the api.
I also noticed that the source of the script is only available if the the same browser session requested the test is trying to view it – seems like some kind of security feature?
Is the above behavior expected? Is there a way to make a request throughout the api and be able to view the console output and script source?

Try passing timeline=1 with the API request. Timeline captures are enabled by default when you come in through the UI and that will get you the console messages.

Yes, the script is not displayed across user sessions (which is a bit complicated when you use the API) just in case there is sensitive information in the script (servers people don't want to expose, etc). If you run a private instance you can choose to expose the script results to all users.
Thanks! setting timeline=1 made it work.
Do you think its default value should be 1 for API calls? I can make a pull request for that on github.
I don't want to switch the defaults out from anyone that is doing automated testing. Maybe at some point in the future.
Reference URL's