1

I have a complex page structure with an iframe (#dialogFrameContent) embbed in another iframe (#migration-iframe).

I'm using await t.switchToIframe('#dialogFrameContent') but I have the following error :

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

         | Selector('#dialogFrameContent')

Is this kind of structure usable with testcafe?

Alex Skorkin
  • 4,264
  • 3
  • 25
  • 47
Sabou
  • 11
  • 1

2 Answers2

1

Yes, you can embed an iframe inside an iframe. You can even embed an iframe inside an iframe inside an iframe inside an iframe. However that can be a performance problem. As a result I do not recommend doing that.

techboyg5
  • 370
  • 2
  • 10
  • Thanks for your answer. I know that embed iframe in iframe is not a good deal but I must test this kind of apps – Sabou May 29 '20 at 13:42
1

Yes, TestCafe allows you to use embedded iframes, but you need to switch to each parent iframe.

await t
    .switchToIframe('#migration-iframe')
    .switchToIframe('#dialogFrameContent');
Artem
  • 921
  • 4
  • 11