Multiple sessions screenshot on failing

Hello,
is there a way to save a screenshot of each session() created on the scenario after failing?

Feature("Testing");

Scenario("Screenshot multiple sessions", (I) => {
	session("one", () => {
		I.amOnPage('http://google.com');
		I.dontSeeInCurrentUrl('http://google.com');
	});
        session("two", () => {
		I.amOnPage('http://google.com');
		I.dontSeeInCurrentUrl('http://google.com');
	});
        session("one", () => {
		I.dontSeeInCurrentUrl('http://google.com');
	});
});

I think we already had it. But only with Puppeteer and Playwright.

Oh, Iā€™m working with selenium webdriverā€¦

I can create a custom helper and initialize a new webdriver on it and finally add the screenshot to the _failed(), but I donā€™t think is the best approach, right?
Sessions are a way easier to work with.

Is it possible to have the same result with on webdriver? Or to have a work around?

I guess codeceptjs would offer this in their new release.

1 Like

Hello again, after the new release i couldnā€™t figure out how to have both screenshots after failing.

 Feature("Testing sessions");
Scenario("Sessions 1 @level1", async function ({ I }) {
  await I.amOnPage("/");
  session("john", async () => {
    await I.amOnPage("/");
    await I.see("You");
  });
});

Current codeceptjs version: 3.6.4
Output folder:
2024-07-03_11-16

Please let me know if Iā€™m doing something wrong.