From 0291b3df87727e4799c35e5be3c042fedabe1657 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Sun, 7 Jun 2026 06:41:30 +0200 Subject: [PATCH] Include URL and iteration number in failure messages Change-Id: I339e53b17e6d29a6fdade4d154234bb2251a7ffd --- lib/core/engine/iteration.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/core/engine/iteration.js b/lib/core/engine/iteration.js index 7e705d65c..d11b60b7a 100644 --- a/lib/core/engine/iteration.js +++ b/lib/core/engine/iteration.js @@ -278,6 +278,11 @@ export class Iteration { try { await navigationScript(context, commands, this.postURLScripts); } catch (error) { + const lastUrl = context.result.at(-1) && context.result.at(-1).url; + const where = lastUrl + ? ` while testing ${lastUrl} (iteration ${context.index})` + : ` (iteration ${context.index})`; + error.message = `${error.message}${where}`; commands.error(error.message); commands.markAsFailure(error.message); throw error;