Differences between running a test through the API and the site

Hi,

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:
http://www.webpagetest.org/runtest.php?script=navigate http%3A%2F%2Fjsfiddle.net%2Fygaras%2F8SfM8%2F &k=XXXXX&location=Dulles:Chrome

Result 1:
http://www.webpagetest.org/screen_shot.php?test=130815_02_1155

Senario 2:
Run the script from home page:
navigate Edit fiddle - JSFiddle - Code Playground
Result 2:
http://www.webpagetest.org/screen_shot.php?test=130815_BD_110G

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?

Thanks.

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.