12. iFrames, Multi-Tabs & Native Dialogs in Java

iFrames with frameLocator

FrameLocator paymentFrame = page.frameLocator("#payment-frame");
paymentFrame.getByLabel("Card Number").fill("4242 4242 4242 4242");

// Multi-tabs:
Page newTab = page.waitForPopup(() -> {
page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName("Docs")).click();
});
assertThat(newTab).hasTitle(Pattern.compile("Documentation"));

Task

  • Implement isAllowedDialog:
  • 1. Accept String dialogType.
  • 2. Return true if dialogType is "alert", "confirm", or "prompt".
πŸ’‘Common doubts
Did you like the problem?
Lesson 12 of 18
Java
Loading code editor…
Next