'playwright- issue with login form - how to navigate to next page
I have a website where I enter the username and password, then I click on the recaptcha field and enter the numbers without any problems but when the login button is pressed, it doesnt navigate to the next page and i'm pretty sure I have selected the right button. (login button is an .
string username = viewModel.UserName;
string password = viewModel.Password;
string field1 = viewModel.Field1;
using var playwright = await Playwright.CreateAsync();
await using var browser
= await playwright.Chromium.LaunchAsync(
new BrowserTypeLaunchOptions { Headless = false, SlowMo = 4000});
await using var context = await browser.NewContextAsync();
var page = await context.NewPageAsync();
await page.GotoAsync("https://enjazit.com.sa/account/login/person");
await page.FillAsync("input[id='UserName']", username);
await page.FillAsync("input[id='Password']", password);
await page.ClickAsync("input[id='Captcha']");
await page.ClickAsync("#btnSubmit");
This is the markup from https://enjazit.com.sa/account/login/person
<div class="input-icon">
<i class="fa fa-user"></i>
<input data-val="true"
data-val-required="The LoginType field is required."
id="LoginType" name="hblystmq" type="hidden" value="Person">
<input type="text" class="required form-control" maxlength="50"
name="szpcvshob"
id="UserName" style="width: 100%;" autocomplete="nope">
</div>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|