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;