我可以使用嵌入式iframe吗?

问题描述 投票:1回答:2

我有一个复杂的页面结构,其中一个iframe(#dialogFrameContent)嵌入另一个iframe(#migration-iframe)。

我正在使用await t.switchToIframe('#dialogFrameContent'),但出现以下错误:

The specified selector does not match any element in the DOM tree.

         | Selector('#dialogFrameContent')

这种结构可用于testcafe吗?

testing iframe automated-tests e2e-testing testcafe
2个回答
1
投票

是的,您可以将iframe嵌入到iframe中。您甚至可以将iframe嵌入iframe内的iframe中。但是,这可能是性能问题。因此,我不建议您这样做。


1
投票

是的,TestCafe允许您使用嵌入式iframe,但是您需要切换到每个父iframe。

await t
    .switchToIframe('#migration-iframe')
    .switchToIframe('#dialogFrameContent');
© www.soinside.com 2019 - 2024. All rights reserved.