При запуске кода я получаю. Java не определена.
Установлена Java, связанная с GrallVM, и ниже приведен код
при выполнении ниже кода « node TestIE.js » возникает ошибка, поскольку Java не определена. определено
он просит проверить наличие библиотеки gu внутри graalvm, но gu отсутствует в /bin. Поскольку его нет, я не могу установить «gu install js». Как установить js в папку graalvm/bin без гу? или есть альтернативный способ решить эту проблему? спасибо
Код: Выделить всё
const { exec } = require("child_process");
const ie = require("selenium-webdriver/ie");
const { runSikuliAction } = require("./sikuliActions");
const { Builder, By, until } = require("selenium-webdriver");
const path = require("path");
(async function TestIE() {
try {
// Path to IEDriverServer executable
const ieDriverPath =
"C:/Users/user/Downloads/IEDriverServer_Win32_4.14.0/";
// Add the IEDriver directory to the PATH
process.env.PATH += `;${ieDriverPath}`;
// Configure Internet Explorer options
let options = new ie.Options();
options.introduceFlakinessByIgnoringProtectedModeSettings(true);
// Create WebDriver instance for Internet Explorer
let driver = await new Builder()
.forBrowser("internet explorer")
.setIeOptions(options)
.build();
// Navigate to a website
console.log("Navigating to Google...");
await driver.get(
"http://google.com"
);
await driver.sleep(20000);
const sikuliJarPath =
"C:\\Users\\user\\Downloads\\sikulixide-2.0.5-win.jar";
const scriptPath = path.resolve(
"C:\\Users\\user\\Downloads\\javascript.sikuli"
);
// Execute the Sikuli script from Node.js
exec(
`java -jar ${sikuliJarPath} -r ${scriptPath}`,
(error, stdout, stderr) => {
if (error) {
console.error(`exec error: ${error}`);
return;
}
console.log(`stdout: ${stdout}`);
console.error(`stderr: ${stderr}`);
}
);
await driver.sleep(20000);
// await driver.wait(until.elementLocated(By.id("otherElement")), 10000);
} finally {
// Close the browser after the actions
//await driver.quit();
}
})();Подробнее здесь: https://stackoverflow.com/questions/793 ... -appearing
Мобильная версия