sitespeedio / sitespeedio/sitespeed.io

Issue facing while including more than one start and stop commands

Open
#4,228 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5k
Forks
624
Avg merge
4h 8m
Merged PRs (30d)
2

Description

Your question

I was executing sitespeed scripts to capture response times. When I tried to run script with including more than one start and stop commands i.e.,
[ await commands.measure.start('');
await commands.measure.stop(); ]

in a script file, I am getting an error. I was not getting with previous version, with updated latest version only I am getting this error.

ERROR: Caught error from Browsertime TypeError: result[resultIndex].files.screenshot[runIndex] is not iterable
at BrowsertimePlugin.processMessage (file:///usr/src/app/lib/plugins/browsertime/index.js:430:76)

Command:
docker run --rm -v "$(pwd):/sitespeed.io" sitespeedio/sitespeed.io XXX.js --multi --viewPort 1786x708 --maxLoadTime 180000 --video=false --visualMetrics=false --visualElements=false --browsertime.screenshot false --browsertime.screenshotLCP false --browsertime.screenshotLS false --plugins.remove screenshot --plugins.remove har -n 1 -b chrome

Script:

await commands.addText.byId('XXX', 'username');
await commands.click.byXpathAndWait("");
await commands.addText.byId('XXX', 'password');
await commands.measure.start('Test1');
await commands.click.byXpathAndWait("");
await commands.measure.stop();
await commands.wait.byXpath("", X0000)

await commands.measure.start('Test2');
await commands.click.byXpathAndWait("");
await commands.click.byXpathAndWait('');
await commands.measure.stop();

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lib/plugins/browsertime/index.js around line 430 and reproduce the failure using the supplied Docker command and script containing two measure.start/stop pairs. Compare this behavior with the previous version if available, then verify that multiple measurements complete without the screenshot iteration error under the stated screenshot and plugin options.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, javascript
Domain
performance, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.