el.click() выдает странную ошибку Selenium Webdriver
У меня есть этот блок кода:
it('tests cookies', opts, async t => {
await driver.get(`${cdthost}/#!/my-acquisitions/${acqId}`).then(function () {
return Promise.delay(3000);
});
await driver.wait(until.elementLocated(By.id(`acq-dropdown-item-${acqId}`)), 4000).then(function () {
console.log(`acq-dropdown-item-${acqId} has been located.`);
});
let el = await driver.findElement(By.id(`acq-dropdown-item-${acqId}`));
console.log('el => ', el);
await el.click().then(() => Promise.delay(2000)).catch(function (e) {
console.error(' => Trapped click() error => ', e.stack || e);
});
return driver.getCurrentUrl().then(function (val) {
assert(val === `${cdthost}/#!/my-acquisitions/${acqId}`, 'We have a hella fast runner.');
})
.catch(function (err) {
console.error(' => Trapped getCurrentUrl() error => ', err.stack || err);
})
});
Я получаю следующую ошибку из вышеприведенной процедуры:
=> Trapped click() error => WebDriverError:
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'c8c5331543cc', ip: '172.18.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.27-moby', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{moz:profile=/tmp/rust_mozprofile.usqz3L7o9x89, rotatable=false, timeouts={implicit=0.0, pageLoad=300000.0, script=30000.0}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0.0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=53.0, platformVersion=4.9.27-moby, moz:processID=445.0, browserName=firefox, javascriptEnabled=true, platformName=linux}]
Session ID: 959d0cca-24a2-4335-b6d3-a60c635cbf36
at Object.checkLegacyResponse (/usr/local/cdt-tests/node_modules/selenium-webdriver/lib/error.js:517:15)
at parseHttpResponse (/usr/local/cdt-tests/node_modules/selenium-webdriver/lib/http.js:509:13)
at doSend.then.response (/usr/local/cdt-tests/node_modules/selenium-webdriver/lib/http.js:441:30)
at process._tickDomainCallback (internal/process/next_tick.js:135:7)
Кто-нибудь знает, почему click() будет выдавать такую ошибку? Что это значит? Как я могу исправить?
Когда я регистрирую el
Я получаю это:
el => WebElement {
driver_:
thenableWebDriverProxy {
flow_: SimpleScheduler {},
session_: PatchedPromise { [Object] },
executor_: Executor { w3c: false, customCommands_: [Object], log_: [Object] },
fileDetector_: null,
onQuit_: [Function: onQuit],
cancel: [Function],
then: [Function: bound ],
catch: [Function: bound ] },
id_: PatchedPromise { '4' } }