Accept a simple alert and read its text
Automation taskEasy-MediumAsked in: Capgemini, Infosys, TCS, Wipro
Interviewers ask: "How do you handle a JavaScript alert?" Switch to it, read its text, accept it. The browser draws the alert outside the page, so normal locators cannot reach it.