Using Cypress, I need to click on a button in an iframe
and also the button which appears in a new window and verify the status.
I am executing below steps:
- Click on a button which is in an
iframe
which then opens a new browser window. - There are two buttons in new window, ‘Success’ and ‘Failure’. I need to click on either of them and browser window will be closed and accordingly status will be updated.
I am able to click on a button in the iframe
, but I am not able to click on the buttons in new window. I am aware about the fact that cypress does not officially supports operations in multi window or tab. Hence we need to set target as blank and I am aware about other workarounds.
The TML looks something like this (without a
or href
)
<div role="button" tabindex="-1">
<div class="abc" data-value="abc" data-index="-1">
<img data-testid="" src="abc.gif" alt="abc" class="abc">
<div class="abc">
<span class="abc">
<span class="abc">BOB</span>
</span>
<div slot="abc">
<div class="abc"></div>
</div>
</div>
</div>
</div>