Combine a Wait, a Frame, and an Alert in One Script
One script can visit three pages. Wait until the 5-second message is visible, read the nested child frame and return to the top document, then accept the simple alert. Print the three texts you observed. Use one function or a small page object. Assert at least one text. Quit with finally or a context manager.
Task:
- Wait for
#appearing5sec and keep its text - Read the child frame text, then return to the top document
- Accept the simple alert and keep its text
- Print the three lines and assert one of them
Aim for a reliable wait, a locator you chose yourself, and cleanup that runs even when a line fails.
Print the lines below exactly.
Expected output:
Appeared: Message appeared after 5 seconds
Frame: Child frame
Alert: This is a simple alert!