Scroll an element into view with JavaScript
Automation taskMediumAsked in: Accenture, Infosys, TCS
Interviewers ask: "How do you scroll to an element, or to the bottom of the page?" Calling scrollIntoView on the element is the usual answer. Selenium 4 also has a wheel action that scrolls to an element without JavaScript. Here you scroll a text field into view with JavaScript, check that it is displayed and print its value.