我正在try Select 一个依赖于输入邮政编码的邮箱选项.下面是我做的
const postcode = page.locator("#postalCode");
const findAddress = page.getByText("Find address", {exact: true});
const selectAddress = page.locator("#addressSelection");
await postcode.fill("GU22 7SS");
await findAddress.click();
await selectAddress.selectOption("37 The Rowans");
我使用的URL是:https://app.pws.int.cruk.org/support-us/details
我试图明确地告诉编剧要 Select 哪个选项,但它超时并显示以下错误:
Error: locator.selectOption: Target closed
=========================== logs ===========================
waiting for locator('#addressSelection')
locator resolved to <select aria-invalid="false" id="addressSelection" name=…>…</select>
selecting specified option(s)
did not find some options - waiting...
============================================================
48 | await postcode.fill("GU22 7SS");
49 | await findAddress.click();
> 50 | await selectAddress.selectOption("37 The Rowans");
| ^
51 |
52 |
53 |
有人能帮帮我吗?