Closed zzhao2010 closed 9 months ago
Hi @zzhao2010 thanks for creating the issue and testing in both Chrome and Firefox. In sitespeed.io we have a little different configurations for Selenium than the default one, I wonder if that could be the issue? Using WebDriver you can choose when a page finished loading and when your script will get back control. In Selenium by default it waits for the unload to happen. However using that configuration there are talk going on between the browser and the webdriver that potentially adds noice. Instead we get back control direct after a navigation and configure to not run the check if the page has finished loading so often.
If you could do a try with running the same settings at Selenium that would be super helpful. You can do that by setting:
--browsertime.pageLoadStrategy normal
Also another thing that differs is the script that we run to "know" when a page is finished. By default we run the script https://github.com/sitespeedio/browsertime/blob/main/lib/core/pageCompleteChecks/defaultPageCompleteCheck.js to know. I wonder if there's a some case where the onloadEventEnd do not fire?
Also is it possible for you to run the tests locally on your machine without Docker? The " "could not find the right index 0 for har for url" usually means that page actually didn't load. If you can run without using Docker you can run your test in --debug
mode checkout https://www.sitespeed.io/documentation/sitespeed.io/scripting/#breakpoint. That's been very helpful for me, then I add a breakpoint and then run JavaScript directly in devtools. For example you can check that unload is really fired and you could look in the network panel and check that nothing else is going on.
Didn't get any feedback so closing.
Have you read the documentation?
URL
https://test.salesforce.com
What are you trying to accomplish
I was trying to profile a page in a Salesforce org, I was able to navigate manually or via Selenium script with either Chrome or Firefox, however the script kept falling apart at the early stage with loading issue via sitespeed.io.
Below is the script. The procedure is quite straightforward. After the preScript for logging in test.salesforce.com, navigate to a url and then do a few clicks based on xpaths in the org to test a custom feature. btw, all xpaths have been validated via Selenium script.
Most of times I received the loading error after the 120s timeout. (The loading took around 9s on average if I navigate through manually). However a few time I received "could not find the right index 0 for har for url" error instead of completely failure such that the filmstrip and snapshots were captured, but there were no performance metrics..
For debugging purposes, I also tried to profile the page that was having loading issue without the following clicks via command
docker run --rm -v "$(pwd):/sitespeed.io" sitespeedio/sitespeed.io:25.11.0 --preScript sf_org_login.js https://sandbox.lightning.force.com/lightning/n/TerritoryFeedback -n 1
and it turned out that the profiling works every time just fine..What browser did you use?
Chrome, Firefox
How to reproduce
Relevant log output