Try to select dropdown item by xpath selector

This commit is contained in:
Laurent Nguyen 2024-07-08 13:07:01 +02:00
parent 7f3dbea39e
commit 8eb42a64e2
1 changed files with 2 additions and 1 deletions

View File

@ -9,7 +9,8 @@ test("Self Serve", async ({ page }) => {
const regionDropdown = explorer.frame.getByText("Select a region"); const regionDropdown = explorer.frame.getByText("Select a region");
await regionDropdown.click(); await regionDropdown.click();
const firstOption = explorer.frame.getByRole("option").first(); await page.waitForSelector("xpath=//button[@role='option'");
const firstOption = explorer.frame.locator("xpath=//button[@role='option'").first();
await firstOption.waitFor(); await firstOption.waitFor();
await firstOption.click(); await firstOption.click();