I am still learning and in response to one of my questions:
WebElement element = driver.findElement(By.id("my-id"));
Actions actions = new Actions(driver);
actions.moveToElement(element);
## actions.click();
actions.perform();
When I try to use the above to scroll to the element: It says WebElement not defined.
I think this is because I have not imported the relevant module. Can someone point out what I am supposed to import?
Edit: As pointed out by alecxe, this was java code.
But in the meantime right after trying to figure it out for some time. I have found out the import method for WebElement:
from selenium.webdriver.remote.webelement import WebElement
Might help someone like me.
The how of it is also a good lesson, IMO: