Home › Selenium Automation (Java)
Actions API Simulates low-level input for things click() and sendKeys() can't express: Interaction Code Hover menu actions.moveToElement(menu).perform() Drag and drop actions.dragAndDrop(source, target).perform() Right / double click contextClick(el), doubleClick(el) Key chords keyDown(Keys.CONTROL).sendKeys("a").keyUp(Keys.CONTROL) Scroll (Selenium 4) scrollToElement(el), scrollByAmount(0, 500) Always end with .perform(). JavaScriptExecutor ((JavascriptExecutor) driver).executeScript(...) runs JS in the page — useful for reading state, scrolling, or setting up test data. Use it sparingly: JS-clicking hidden elements bypasses what a real user can do and can hide genuine bugs.