2

We have to test an iframe that is developed by our team but launches from a partner website. But currently, there is no way to launch the iframe. So, the team asked us to automate the iframe in w3schools. So, what we are doing is, going to w3schools iframe and removing the example code and inserting our iframe code to generate the iframe and this is being done as part of our e2e automation.

So, firstly, we are not testing the iframe directly but an iframe within an iframe. And secondly, the time that it takes to load the iframe is enormous.

Is this a recommended way to test (when you don't have a way to directly test something)?

4
  • 1
    Did I understood correctly - you are doing automated E2E testing in production environment while calling iframe from 3rd party website? – Prome Aug 17 '20 at 7:34
  • Not in production but in one of the test environments – Aalok Aug 17 '20 at 7:51
  • What is preventing you from testing the iframe included code like a normal website? – Lee Jensen Aug 17 '20 at 18:55
  • Well it’s not integrated to any website at the moment. – Aalok Aug 17 '20 at 21:47
3

Is it of value to e2e test something in an iframe that is supposed to be in an iframe? Well, yes. You want to test that it works as expected.

I would probably suggest doing the bulk of any testing directly against the framed content itself and only test it in a frame for any interaction that may occur and that it works as expected in the first place, that navigation within a frame works etc.

As for the other issue, why can you not simply build a test site with the content framed -- locally or on a live test site you control? That would allow the tests to more naturally mimic the 3rd party production site.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.