Home > Enterprise >  I can´t click on an element with selenium, how can i click anyways?
I can´t click on an element with selenium, how can i click anyways?

Time:09-29

i want to click this element but its says another element would be clicked, but i dont care because it´s a select:

let input_provinces = await driver.findElement(By.id("select_provinces")).click();

Does anyone know how to force the click? Thanks!

CodePudding user response:

I think you're using Selenium with JavaScript , I'm providing a suggestion, you can try this one if it works for you.

let input_provinces = await driver.findElement(By.id("select_provinces"));
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("arguments[0].click();", input_provinces);

  • Related