Blog
The team4 min read

Rehearse before you record

In our prototype, finding the right gestures took 60% of the time. So every scene is played through, captured, read and fixed before we film.

When we made our first demo video by hand, we expected the voice or the editing to take the longest. Wrong. About 60% of the two hours went into finding the right gestures.

A tips bubble to dismiss before you can tap anything. A sheet that asks for confirmation. The wrong card tapped. Coordinates that are right on one screen and wrong on the next. Each mistake cost a whole take, and we only found it by watching the video.

A failed gesture costs a take

Recording is expensive. You launch the app, prepare the data, record the screen, wait for the scene to end. If the fourth gesture fails, the first three are wasted.

A person recording their own screen corrects by eye without thinking. They see the bubble, close it, and carry on. An automated driver doesn't: it taps where it was told to tap, even if the screen changed in the meantime.

Hence one simple rule: we never record a scene that hasn't been played first.

The rehearsal

Before recording, every scene in the script is played for real, without recording. At the end of each scene we keep two things: a screenshot, and the visible text of the page. That is enough to know whether we are in the right place, and light enough to be fast.

Gestures aim at targets, from the most robust to the most fragile:

  1. a test id;
  2. a Flutter key;
  3. a role and a name, like "the Check button";
  4. a label, or a field's placeholder;
  5. visible text;
  6. a CSS selector;
  7. and as a very last resort, coordinates.

Pullscene picks these targets by reading the code on the branch: the routes, the translation files, the widget keys. It doesn't guess where the button is. It looks up what the button is called.

When it fails, Pullscene fixes it

A step fails: an element can't be found, or the screen is the wrong one. Instead of stopping, the scene goes back to the script writer with its screenshot and visible text. It sees what the app actually showed, fixes the script, and the scene is played again.

A real example. On Proofit, pull request #19, injury mode, a "Close" button was mistargeted. The rehearsal caught it, the script writer fixed the target, and the scene passed. The video came out without anyone touching it: 1 min 03, recorded on the iOS simulator, with that single automatic fix.

And if a scene still fails after the fix, autopilot does not record. The video stops at "needs review", with a screenshot of what is stuck. You fix the script, or you drop the scene. We don't want a video that shows a broken screen without saying so.

When the screen contradicts the plan

The most interesting case is not the failed gesture. It is when everything works, just not as planned.

On Qelka, a web app, the script planned to validate an IBAN on the French version of the site and show the result. The gestures passed. But the screenshot told a different story from the plan: on /fr, the IBAN result was still in English.

There were two wrong ways to handle it. Hide the problem by cutting the scene. Or keep the planned line, which described a translated result, while the screen showed English. The voice would have contradicted the picture, and the first attentive viewer would have noticed.

We did the third thing: the voice follows the screen. It describes what you actually see, and the gap goes into "what's left", the list of what is missing before release. The Qelka video, 7 commits told in 1 min 17, shipped with that flaw said out loud.

It's a side effect we didn't expect. A rehearsal is a small end-to-end test, written by someone who read the pull request and who actually looks at the screen. It finds things.

Always on a copy, never production

Rehearsing means playing the gestures for real: filling forms, submitting, confirming. So we do it on the app's demo mode, or on a test stack. Never on production.

The script can also carry a reset command, run before each rehearsal and before the recording. We added it after a very concrete lesson: Qelka's free tools have a daily quota, our rehearsals had used it up, and the recording stopped on a rate limit message. Since then, every pass starts from a clean state.

What you see

After the rehearsal, you get every scene with its screenshot and status. You read the script like a text, see what will be recorded, and start the recording. Or you let autopilot carry on: it stops by itself if a scene keeps failing.

The result is a video that makes fewer mistakes than a person in a hurry, and says so when it couldn't show something.