Skip to content

[Bug]: Microsoft.Playwright.PlaywrightException : Execution context was destroyed, most likely because of a navigation #36851

@katsiaryna-firsava-epam

Description

Version

1.54.0

Steps to reproduce

One of the failing test:

await _page.GotoAsync(context.TestStandUrl);
await page.Locator(_oktaLoginPage.GetOktaWidgetUsernameInput().XpathSelector).FillAsync(testUser.UserName);
await page.Locator(_oktaLoginPage.GetOktaWidgetPasswordInput().XpathSelector).FillAsync(testUser.Password);
await page.Locator(_oktaLoginPage.GetOktaWidgetSignInBtn().XpathSelector).ClickAsync();

await page.Locator(_basePage.GetDriveSafelyPopupEl().XpathSelector).WaitForAsync(new() { State = Microsoft.Playwright.WaitForSelectorState.Visible, Timeout = timeout });

await page.Locator(_homePage.GetMapMarkerEl().XpathSelector).CountAsync() > 0;
await page.Locator(_homePage.GetMapLoadingInProgressEl().XpathSelector).CountAsync() == 0;

await page.Locator(_homePage.GetAssignmentLeaderPopUpCloseBtn().XpathSelector).IsVisibleAsync())
await page.Locator(_homePage.GetAssignmentLeaderPopUpCloseBtn().XpathSelector).ClickAsync();

await page.Locator(_homePage.GetTilesLblList().CssSelector).GetByText(tile.GetStringValue()).ClickAsync(new() { Force = true })

await page.Locator(_benefitsPage.GetBenefitsLbl().XpathSelector).TextContentAsync();

Expected behavior

Tests are running without issues

Actual behavior

I have about 60 tests, and they are randomly failing with error: Microsoft.Playwright.PlaywrightException : Execution context was destroyed, most likely because of a navigation

This started happening after updating to version 1.54.0

Additional context

No response

Environment

Microsoft Windows 11 Enterprise
RAM: 32

Browser: Google Chrome
Playwright: 1.54.0
.Net nuget package 

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions