sitespeedio / sitespeed.io

sitespeed.io is an open-source tool for comprehensive web performance analysis, enabling you to test, monitor, and optimize your website’s speed using real browsers in various environments.
https://www.sitespeed.io/
MIT License
4.76k stars 603 forks source link

I'm getting "ERROR: Could not add meta data to the HAR error" while running in Git Hub. #4325

Open pjayaweera opened 6 days ago

pjayaweera commented 6 days ago

Your question

I'm getting attached(screenshot) error while execute the script through GitHub Action. But surprise is same i executed locally and not getting any errors. Could you please help on this.

Screenshot 2024-11-25 143650_error

code.txt

pjayaweera commented 6 days ago

I have to do several user transaction and not change URL. So, i'm using following mechanism.

await commands.measure.start('Click on Generate Pagination Sheet'); const currentURL1 = await driver.getCurrentUrl(); const script1 = 'history.pushState({}, "", "' + currentURL1 + '")' ; console.log('script is : ' + script1); await driver.executeScript(script1); await commands.click.byXpath('//*[@id="sections-tabpanel-1"]/div/div/div/div/div/div[2]/button'); await commands.wait.byPageToComplete(); await commands.wait.byTime(5000); await commands.measure.stop(); await commands.wait.byTime(3000); console.log("Click on Generate Pagination Sheet Completed");

soulgalore commented 6 days ago

It seems like the metrics from the video is all 0, so something is wrong. I would store the the result files and check them out. There are some documentation on how to do that https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/storing-and-sharing-data-from-a-workflow

pjayaweera commented 5 days ago

When i comment the following piece of code in js file it runs without any issues. it seems issue is in the that code. But when i run it locally no issues are observing. Do you see any issue in this code?

await commands.measure.start('Click on Generate Pagination Sheet'); const currentURL1 = await driver.getCurrentUrl(); const script1 = 'history.pushState({}, "", "' + currentURL1 + '")' ; console.log('script is : ' + script1); await driver.executeScript(script1); await commands.click.byXpath('//*[@id="sections-tabpanel-1"]/div/div/div/div/div/div[2]/button'); await commands.wait.byPageToComplete(); await commands.wait.byTime(5000); await commands.measure.stop(); await commands.wait.byTime(3000); console.log("Click on Generate Pagination Sheet Completed");

soulgalore commented 5 days ago

Check if if you can store the result so you can look at the video and the screenshots, are you really navigating to the pages? Be more defensive in your test: verify that the element exists, add more logs.

pjayaweera commented 5 days ago

I can store result unless it pass or failed. yml file is written like that way. Also i can see screenshots as well. But videos are not available. I'm navigating to a logout page. But same URL as login is there. that's why i used history.pushState({} method to overcome the issues.

can i know which Nodejs version sitespeed.io image using? Because in my local machine using Nodejs 18 version and this script running there without any issues. I have doubt sitespeed.io docker i'm using have some compatibility issues since this same script not running there as expected.

pjayaweera commented 5 days ago

In screenshot i don't see any errors. screenshots shows that user navigates to the expected page. In result shows like this way ![Uploading Screenshot 2024-11-26 124545_result.png…]()

pjayaweera commented 5 days ago

![Uploading Screenshot 2024-11-26 124706_result2.png…]()

soulgalore commented 5 days ago

It seems like your screenshots didn't get uploaded to the issue? I didn't fully get what you want to do with the history push thing. If you use alias for your measurements you can name each page, even if it's the same URL. Some pages get the same browser API metrics (like first paint, fcp). Is that a SPA or I think the page do not navigate.