Switch back to the default content
Medium70 pts~25 min
- iframes
- Default content
Practice app · Secure Checkout
A payment widget inside an iframe and a nested iframe structure.
Your starter code already declares TEST_URL — never hardcode a host.
Objective
Complete the payment inside the iframe, then return to the top-level document and fill in the delivery note.
Your task
- 1Switch into #payment-frame and pay with card 4242424242424242 (#card-number, #pay-button).
- 2Assert #pay-result reads “Payment authorized”.
- 3Switch back with defaultContent() / default_content() / DefaultContent().
- 4Assert #main-heading reads “Secure checkout” and type “Leave at reception” into #order-note.
Acceptance criteria
- defaultContent is used to leave the frame
- #pay-result shows “Payment authorized”
- #order-note contains “Leave at reception”
- At least 2 assertions pass
Selenium WebDriver 4 · Selenium · Frames, windows & tabs