【发布时间】:2019-07-06 10:32:26
【问题描述】:
页面结构如下:
<html>
<body>
...
<button class="myclass1" type="button">Continue1</button>
...
#document
<html>
<body>
<button class="myclass" type="button">Continue2</button>
如何单击按钮继续2?
我正在尝试使用 expect-puppeteer。但是,如果您有 puppeteer 的解决方案,那么我会使用它。
await expect(page).toClick('button', { text: 'Continue2'}); // not work(Nested html)
await expect(page).toClick('button', { text: 'Continue1'}); // work
【问题讨论】:
-
嵌套文档是 iframe 的一部分吗?
-
-
你能以某种方式识别 iFrame 吗?
-
是 id="iframe-1"
标签: javascript html node.js puppeteer