JavascriptExecutor can be your next life-saver
Before we proceed with this I would like to emphasize this method is not encouraged to use in test automation, this should be the last option of your automation path.
Why?
This approach is not simulating the end-user but rather uses a technical mechanism to fire actions on the web page. This will not 100% guarantee the functionality is working as expected…