Open pjayaweera opened 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");
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
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");
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.
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.
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…]()
![Uploading Screenshot 2024-11-26 124706_result2.png…]()
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.
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.
code.txt