Open dancowen opened 9 years ago
The resulting HAR file is missing the Post data sent in a form.
What Firefox and HARExportTrigger version are you using? What preferences do you have set?
My test scenario is: 1) Load http://janodvarko.cz/har/tests/har-export-trigger/har-export-api.html 2) Set contentAPIToken and enableAutomation prefs 3) Open the Toolbox 4) Click the "Post Data" button 5) Click the "HAR Export" button 6) Check out the Console panel and exported data. I can see the posted data.
@ukboris Does this work for you? If yes, what could be different in your scenario?
Honza
Yes that works for me, but when triggering from Selenium we need to use JavaScript to trigger the file export. When the JavaScript is used the file is missing the values sent to the server in the post request.
@ukboris could this problem be rather related to Selenium? If it works manually why it doesn't work in Selenium?
Honza
I'm using Selenium to export data by firing the following JavaScript on the browser:
var options = { token: "test", fileName: "my test har file %Y, %H:%M:%S" // Name of the file };
HAR.triggerExport(options).then(result => { // The local file is available now });
The resulting HAR file is missing the Post data sent in a form. The same occurs when pasting the JavaScript into the console at the same point Selenium would trigger the export, regardless of whether the actions have been input manually or driven from the Selenium.
Example - exported using Javascript and har export api:
"postData": { "mimeType": "application/x-www-form-urlencoded", "mimeType": "application/x-www-form-urlencoded", "params": [ "params": [],
Example - exported by right-clicking on network pane and copy as har (username and password have been removed):
"postData": { "postData": { "mimeType": "application/x-www-form-urlencoded", "mimeType": "application/x-www-form-urlencoded", "params": [ "params": [], {>">"
"name": "QuickJump",
"value": ""
},
{
"name": "Login:LoginScreen:LoginDV:username",
"value": "<
},
{
"name": "Login:LoginScreen:LoginDV:password",
"value": "<
},
{
"name": "csrfToken",
"value": "cd9f6d030a754c893ff7ec8834226a9cb258ca9d"
},
{
"name": "eventSource",
"value": "Login:LoginScreen:LoginDV:submit_act"
},
{
"name": "objFocusId",
"value": "Login:LoginScreen:LoginDV:submit"
}
],