0

I want to click element inside the iframe. I would like to know the current iframe context or How many iframe present before switching to any other iframe. How to check current iframe context in WDIO[7]?

I have tried below code.

 await $('.framed_view').waitForDisplayed({ timeout: 500000 })
 console.log('current context:'+ await browser.getContext());
 await browser.switchToFrame(1);

Which WDIO api supposed to use to get current context information like selenium webdriver?

Vaibhav Jagdale
  • 229
  • 2
  • 11

1 Answers1

0

have you tried something like this?

it('should switch focus to iFrame', function () {
    // Using `element` to find an iframe and providing it to `frame` method
    await browser.waitForExist('iframe[name="my_iframe"]');
    var my_frame = await $('iframe[name="my_iframe"]').value;
    await browser.frame(my_frame);
});

This way it would be easier for you to change to the desired iframe. Let me know if this helps!