Anna Ramolini
Anna Ramolini

Reputation: 65

How to check the "Log XMLHttpRequests" in the developer tools settings via robot framework

I am trying to retrieve the ajax calls (post, get, put...) that show up in the console of a website with Robot Framework. I could do it with How to read the web console output with robot framework and selenium?. However the console only logs the ajax calls when the "Log XMLHttpRequests" is checked in the developer tools settings. by default it is not, so I do not see the calls in the returned log. Do you know how to have that box clicked in the "settings" via Robot Framework/Selenium? Thank you.

Upvotes: 1

Views: 507

Answers (1)

Bence Kaulics
Bence Kaulics

Reputation: 7281

Update the logging capabilities with the performance=ALL in addition to the browser=ALL like:

*** Variables ***
&{browser logging capability}    browser=ALL    performance=ALL
&{capabilities}    browserName=chrome    version=${EMPTY}    platform=ANY    goog:loggingPrefs=${browser logging capability}

Then retrieve the additional logs from the webdriver like:

${log entries}=    Evaluate    $webdriver.get_log('performance')

Upvotes: 1

Related Questions