selenium-ide icon indicating copy to clipboard operation
selenium-ide copied to clipboard

HAR (HTTP Archive) data is not being generated correctly.

Open fmrahman opened this issue 9 months ago • 7 comments

💥 Regression Report

In selenium-side-runner 4.0.8, when capturing the HTTP Archive (HAR) data, the output appears to be incorrect. The data does not reflect the expected structure and content, resulting in incomplete or malformed HAR files. It used to work fine in 3.17.0. I am using the API devtools.network.getHAR() to capture the HAR from my Chrome plugin. I am dumping the HAR data during the onLoad and onClick events.

I wondered why there is a regression in Chrome API in the latest selenium-side-runner version.

Attached complete HAR files for reference.

Selv4.0.8_HAR.txt Selv3.17.0_HAR.txt

Below are the notable differences I found in the HAR data.

Sample output of HAR captured in 4.0.8: { "version": "1.2", "creator": { "name": "WebInspector", "version": "537.36" }, "pages": [], "entries": [ {

Sample output of HAR captured in 3.17.0 {"log":{ "version": "1.2", "creator": { "name": "WebInspector", "version": "537.36" }, "pages": [ { "startedDateTime": "2024-05-23T12:25:18.448Z", "id": "page_1", "title": "https://opensource-demo.orangehrmlive.com/web/index.php/auth/login", "pageTimings": { "onContentLoad": 6203.97699996829, "onLoad": 6204.739999957383 } } ], "entries": [ {

The difference is that 'pages' object is empty in the 4.0.8 version. Also, the number of entries in the 4.0.8 HAR file is lesser when compared with the 3.17.0 HAR file.

Last working version

Worked up to version: 3.17.0

Stopped working in version: 4.0.8

To Reproduce

Steps to reproduce the behavior: To dump the HAR data using the API devtools.network.getHAR(). Sample code to dump HAR data as part of the Chrome plugin.

Expected behavior

After invoking the HAR API proper HAR data should be generated as per the standard.

Project file reproducing this issue (highly encouraged)

Please provide a project file .side that reproduces this issue. { "id": "ac4bb5e3-0ac8-4890-831e-a33062e445d8", "version": "2.0", "name": "Orange", "url": "https://opensource-demo.orangehrmlive.com", "tests": [{ "id": "0208b7e5-acf9-49ae-849e-6a11c634db7b", "name": "t1", "commands": [{ "id": "186c1f41-3d9b-4767-93b9-1acbc9633270", "comment": "", "command": "open", "target": "/web/index.php/auth/login", "targets": [], "value": "" }, { "id": "04484fb3-ecdc-49e9-a97a-f42ff5a45349", "comment": "", "command": "setWindowSize", "target": "1400x970", "targets": [], "value": "" }, { "id": "4e787659-7f44-4bf7-8e78-0d69dadca301", "comment": "", "command": "type", "target": "name=username", "targets": [ ["name=username", "name"], ["css=.oxd-input--focus", "css:finder"], ["xpath=//input[@name='username']", "xpath:attributes"], ["xpath=//div[@id='app']/div/div/div/div/div[2]/div[2]/form/div/div/div[2]/input", "xpath:idRelative"], ["xpath=//div[2]/input", "xpath:position"] ], "value": "Admin" }, { "id": "72e65992-5f57-461f-b133-5aa87a83ae2f", "comment": "", "command": "click", "target": "name=password", "targets": [ ["name=password", "name"], ["css=.oxd-input--focus", "css:finder"], ["xpath=//input[@name='password']", "xpath:attributes"], ["xpath=//div[@id='app']/div/div/div/div/div[2]/div[2]/form/div[2]/div/div[2]/input", "xpath:idRelative"], ["xpath=//div[2]/div/div[2]/input", "xpath:position"] ], "value": "" }, { "id": "686e15db-0fbf-43b7-a98c-9ac0c9f70382", "comment": "", "command": "type", "target": "name=password", "targets": [ ["name=password", "name"], ["css=.oxd-input--focus", "css:finder"], ["xpath=//input[@name='password']", "xpath:attributes"], ["xpath=//div[@id='app']/div/div/div/div/div[2]/div[2]/form/div[2]/div/div[2]/input", "xpath:idRelative"], ["xpath=//div[2]/div/div[2]/input", "xpath:position"] ], "value": "admin123" }, { "id": "991f9370-d21c-4d2b-a266-f7a65584f71e", "comment": "", "command": "click", "target": "css=.oxd-button", "targets": [ ["css=.oxd-button", "css:finder"], ["xpath=//button[@type='submit']", "xpath:attributes"], ["xpath=//div[@id='app']/div/div/div/div/div[2]/div[2]/form/div[3]/button", "xpath:idRelative"], ["xpath=//button", "xpath:position"], ["xpath=//button[contains(.,'Login')]", "xpath:innerText"] ], "value": "" }, { "id": "1860fbb8-37bb-4c91-8330-636e50b9da7c", "comment": "", "command": "click", "target": "css=.oxd-main-menu-item-wrapper:nth-child(1) .oxd-text", "targets": [ ["css=.oxd-main-menu-item-wrapper:nth-child(1) .oxd-text", "css:finder"], ["xpath=//div[@id='app']/div/div/aside/nav/div[2]/ul/li/a/span", "xpath:idRelative"], ["xpath=//span", "xpath:position"], ["xpath=//span[contains(.,'Admin')]", "xpath:innerText"] ], "value": "" }, { "id": "58b7f7c6-2ef5-439f-91aa-fd1b4cec8e12", "comment": "", "command": "click", "target": "css=.oxd-userdropdown-icon", "targets": [ ["css=.oxd-userdropdown-icon", "css:finder"], ["xpath=//div[@id='app']/div/div/header/div/div[2]/ul/li/span/i", "xpath:idRelative"], ["xpath=//span/i", "xpath:position"] ], "value": "" }, { "id": "80a16b72-1410-40c6-84dd-c3c3bcee9d46", "comment": "", "command": "pause", "target": "3000", "targets": [], "value": "" }, { "id": "bb10784c-f494-4a6c-b076-d6d76b5d0190", "comment": "", "command": "click", "target": "linkText=Logout", "targets": [ ["linkText=Logout", "linkText"], ["css=li:nth-child(4) > .oxd-userdropdown-link", "css:finder"], ["xpath=//a[contains(text(),'Logout')]", "xpath:link"], ["xpath=//div[@id='app']/div/div/header/div/div[2]/ul/li/ul/li[4]/a", "xpath:idRelative"], ["xpath=//a[contains(@href, '/web/index.php/auth/logout')]", "xpath:href"], ["xpath=//li/ul/li[4]/a", "xpath:position"], ["xpath=//a[contains(.,'Logout')]", "xpath:innerText"] ], "value": "" }] }], "suites": [{ "id": "76a9ba22-37a6-4aec-ae9d-fa685bb66b4f", "name": "Default Suite", "persistSession": false, "parallel": false, "timeout": 300, "tests": ["0208b7e5-acf9-49ae-849e-6a11c634db7b"] }], "urls": ["https://opensource-demo.orangehrmlive.com/"], "plugins": [] }

Issues without a reproduction project are likely to stall.

Environment

OS: Linux 7 Selenium IDE Version: 3.17.0 Selenium SIDE Runner Version: 4.0.8 Please note that selenium-side-runner supports Node.js 8 - 10

Node version: v16.13.1 Only required if using selenium-side-runner

Browser: Google Chrome Browser Version: 120.0.6099.224 ChromeDriver 120.0.6099.109

fmrahman avatar May 24 '24 10:05 fmrahman