Search This Blog
A dedicated site offering various scenarios to practice web automation, including elements like sliders, tables, and forms
A dedicated site offering various scenarios to practice web automation, including elements like sliders, tables, and forms
import { test, expect } from '@playwright/test';
ReplyDeletetest('test', async ({ page }) => {
await page.goto('https://stag1.asknestle.in/login');
await page.waitForTimeout(4000);
await page.getByPlaceholder('Email *').fill('autotestt@gmail.com');
await page.getByPlaceholder('Enter your Password *').fill('Test@123');
await page.getByRole('button', { name: 'Login' }).click();
await page.waitForLoadState('networkidle');
}); using this code in playwright while executing the code first time it's work fine but when again and again run this code images not loaded also journey not completed fully.
import { test, expect } from '@playwright/test';
ReplyDeletetest('User Registration Flow', async ({ page }) => {
// Navigate to the registration page
await page.goto('https://stag1.asknestle.in/user/register');
// Step 1: Fill in email and password
await page.getByPlaceholder('Please enter your email').fill('autotes13@gmail.com');
await page.getByPlaceholder('Enter your Password *', { exact: true }).fill('Test@123');
await page.getByPlaceholder('Re-enter your Password *').fill('Test@123');
// Check the agreements
await page.locator('label').filter({ hasText: 'I would like to receive news' }).click();
await page.locator('label').filter({ hasText: 'By proceeding I confirm I am' }).click();
// Submit the registration form
await page.getByRole('button', { name: 'Create account' }).click();
// Step 2: Fill in personal details
await page.getByPlaceholder('Please enter First Name *').fill('Princy');
await page.getByPlaceholder('Please enter Last Name *').fill('Jain');
await page.getByPlaceholder('Please enter your 10 digit').fill('9109105384');
await page.getByText('Date Of Birth* Age Group18-50').click();
await page.getByPlaceholder('eg. 13/09/1997 *').fill('2007-01-15');
// Select gender
await page.getByRole('img', { name: 'female' }).click();
// Proceed to the next step
await page.getByRole('button', { name: 'Next' }).click();
// Step 3: Enter physical details
await page.getByPlaceholder('Please enter Height').fill('40');
await page.getByPlaceholder('Please enter Weight').fill('25');
await page.getByRole('button', { name: 'Next' }).click();
// Step 4: Select dietary preferences
await page.getByRole('group').locator('div').filter({ hasText: 'Vegetarian' }).nth(2).click();
await page.getByRole('button', { name: 'Next' }).click();
// Step 5: Select region
await page.getByText('West India').click();
await page.getByRole('button', { name: 'Next' }).click();
// Step 6: Select dietary restrictions
await page.locator('#gigya-register-screen-5 div').filter({ hasText: 'Gluten ( Wheat, Barley, Rye,' }).nth(3).click();
await page.getByText('Lactose').click();
await page.getByRole('button', { name: 'Finish' }).click();
// Wait for the dashboard button to appear
await page.locator('text=Go to dashboard').waitFor({ state: 'visible', timeout: 5000 });
// Navigate to the dashboard
await page.locator('text=Go to dashboard').click();
// Validate successful navigation
await expect(page).toHaveURL(/dashboard/);
});
using this code in playwright while executing this code first time it's work fine but when again and again did not loaded also journey not completed
Even manually not working as expected. this is application issue
Delete1.import { test, expect } from '@playwright/test';
ReplyDeletetest.only('test', async ({ page }) => {
await page.goto('https://stag1.asknestle.in/login');
await page.getByPlaceholder('Email *').waitFor({state:'visible'})
await page.getByPlaceholder('Email *').fill('autotestt@gmail.com');
await page.getByPlaceholder('Enter your Password *').fill('Test@123');
await page.getByRole('button', { name: 'Login' }).click();
await page.waitForLoadState('networkidle');
});
This comment has been removed by the author.
ReplyDeleteyou can run above code multiple times without issue.
ReplyDelete