PlayWright Login Issue due to Captcha Interference

Viewed 246

I am new to PlayWright and C# integration. I am opening the home page of my application and trying to input the username, password and click the button which should enable the google captcha. I need to solve the captcha and move to the next page.

However, when I was trying to click the Button with PlayWright, nothing happens until I press some keys on my keyboard which immediately activates the google captcha.

My code is as below.

await page.FillAsync(selector: "#email", value: "test@gmail.com");
await page.FillAsync(selector: "#password", value: "Pass.123");
            
await page.Locator("button", new PageLocatorOptions {
  HasTextString = "SIGN IN",
}).ClickAsync();
            
//await page.FillAsync(selector: "#password", value: "Yadu@1985");
//await page.WaitForNavigationAsync();
await page.ScreenshotAsync(new PageScreenshotOptions {
  FullPage = true,
  Path = "c:\\sample\\screenshot.jpg"
});
0 Answers
Related