I am having trouble trying to perform a mouse click based on position. No matter what I try, I keep receiving the same error message. I encountered this issue when attempting a double click on the main search bar of google.com.
For assistance, refer to: https://nodejs.org/en/docs/inspector (node:38864) UnhandledPromiseRejectionWarning: UnknownCommandError: Unrecognized command: actions warning.js:18 at buildRequest (c:\GitRepo\MMT4\src\javascript\Web.Tests\node_modules\selenium-webdriver\lib\http.js:375:9) at Executor.execute (c:\GitRepo\MMT4\src\javascript\Web.Tests\node_modules\selenium-webdriver\lib\http.js:455:19) at Driver.execute (c:\GitRepo\MMT4\src\javascript\Web.Tests\node_modules\selenium-webdriver\lib\webdriver.js:696:38) at process._tickCallback (internal/process/next_tick.js:68:7) (node:38864) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3) warning.js:18 (node:38864) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I have installed the required packages using npm
"devDependencies": {
"@types/node": "^10.12.0"
},
"dependencies": {
"chromedriver": "^2.43.0",
"selenium-webdriver": "^4.0.0-alpha.1"
}
The documentation suggests that it should work as intended https://seleniumhq.github.io/selenium/docs/api/javascript/index.html https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/lib/input_exports_Actions.html
I have also come across various examples online supporting the functionality, but still can't figure out what is missing in my basic implementation:
"use strict";
require('chromedriver');
const { Builder, By, Key, until, ActionSequence } = require('selenium-webdriver');
(async function run() {
let driver = await new Builder().forBrowser('chrome').build();
try {
await driver.get('http://www.google.com');
await driver
.actions()
.doubleClick(By.id('lst-ib'))
.perform();
}
finally {
await driver.quit();
}
})();
I also tried integrating it into a protractor project where it seemed to function correctly. However, I am unsure why Protractor would be necessary for this project since it does not involve Angular.
Any insights would be appreciated. Thank you