I am testing, and I have to click on elements, but it sometimes click, sometimes not. I tried some solutions, but there is no one, which always clicks. Is there any solution to click an element, which always works?
I tried these codes:
1:
await driver.findElement(By.id("u_0_a")).click();
2:
var element = await driver.findElement(By.id("u_0_a"));
await element.click();
3:
await driver.executeScript("document.getElementById('u_0_a').click()");
I use selenium with node.js, javascript, chrome driver.
click()function in JavaScript does not execute any "click" event handlers.