catchpoint / WebPageTest.bulk-tester

Google App Script for spreadsheet that uses the WPT API to bulk test URLs
MIT License
259 stars 22 forks source link

Referring to ConsoleLog from Web Page Test Results #19

Closed spencershaw closed 7 years ago

spencershaw commented 7 years ago

There is a ConsoleLog element in the response. But it has multiple sub elements. e.g.

<consoleLog>
<entry>
<source>console-api</source>
<level>warning</level>
<message>
JQMIGRATE: jQuery.fn.andSelf() replaced by jQuery.fn.addBack()
</message>
<url>
https://d10d8p3bp9wpno.cloudfront.net/media/js/fafd3e053bab5cabb970f7edd7f54700.js
</url>
<line>12522</line>
</entry>
<entry>
<source>console-api</source>
<level>warning</level>
<message>JQMIGRATE: jQuery.browser is deprecated</message>
<url>
https://d10d8p3bp9wpno.cloudfront.net/media/js/fafd3e053bab5cabb970f7edd7f54700.js
</url>
<line>12522</line>
</entry>
</consoleLog>

How do you refer to the message element?

I have tried data.median.firstView.consoleLog.entry.message but it says undefined.

Taken fro https://www.webpagetest.org/result/161117_X3_2A6F/?f=xml

spencershaw commented 7 years ago

Actually, this works: data.median.firstView.consoleLog