I am a beginner in using Selenium and encountering challenges with basic tasks.
My current struggle involves moving the mouse to specific coordinates (x, y) on a webpage and clicking, but so far, I have not been successful. Despite referring to the documentation, I am utilizing {bridge: true}
due to the chromewebdriver implementation.
Below is the code snippet:
var webdriver = require('selenium-webdriver'),
By = webdriver.By,
until = webdriver.until,
Origin = webdriver;
var driver = new webdriver.Builder()
.forBrowser('chrome')
.build();
driver.get('http://www.localhost:4000/');
var actions = driver.actions({ bridge: true });
actions.mouse().move({x: 400, y: 1100, duration: 2000, origin: Origin.VIEWPORT});
Another query arises regarding the fourth parameter origin origin: Origin.VIEWPORT
. I am uncertain if it was imported correctly.
Furthermore, I am unsure of how to trigger the click event as there is no selected element. My goal is to click at the final position of the mouse pointer.