Read the page source and search it
Automation taskEasy
Interviewers ask: "How do you check that some text or an id appears somewhere in the page HTML?" Reading the page source is one quick answer. Know its limit: it is a snapshot of the current page as text, so it cannot tell you whether something is visible or clickable. Locating elements is still the reliable way to test. Here you check that the source contains two element ids and is not empty.