DEV Community

Preetham Kalpuri
Preetham Kalpuri

Posted on

Playwright - Remember me functionality

Hello Team, I have a scenario i.e. Automate remember me Toggle Functionality.

Below are the steps executed manually:

1. I will be launching an application
2. Once launched I will be logging into application by passing user name and password and checking the toggle i.e. remember me toggle. 
3. Post successful login I will be closing the browser
4. I would open the browser again 
5. I Will be launching the same application (Navigating to URL), so It would be logged in. 
6.Here I will be trying to access any personal information it would ask for the password authentication again on the same session.
Enter fullscreen mode Exit fullscreen mode

So this the manual execution and it is working as expected. When it comes to automation, it is not working as expected.

Below is the script executed in playwright:
const loginInstance = featureInstances['login'] as Login;
await loginInstance.LoginWithRememberMeToggleOn(userData.emailaddress, userData.password);
const storageState = await context.storageState();
console.log(storageState);
await page.close();
const newContext = await browser.newContext({ storageState });
const newPage = await newContext.newPage();
await loginInstance.ValidateRememberMeLoginToggle(newPage);

When I am executing in automation, it just launching the application without populating password authentication page.

Any leads with solution, it would be grateful. Thanks in advance.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Retry later