Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

264
Vistas
ElementClickInterceptedError: element click intercepted. Selenium Javascript Chromedriver

I am having problems with clicking an element in a dropdown. What i have to do is:

  1. Open https://pastebin.com
  2. paste "Hello from WebDriver"
  3. Set Paste Expiration to "10 Minutes"
  4. Set Paste Title to "helloweb"

However, after opening the dropdown some 3rd party ad content doesn't let me click my button, which results in ElementClickInterceptedError

Here is my code

const {Browser} = require('selenium-webdriver');
const {Builder, By, Key, until} = require('selenium-webdriver');

(async function example() {
  let driver = await new Builder().forBrowser('chrome').build();
  driver.manage().window().maximize();

  try {
    await driver.get('https://pastebin.com');
    await driver.findElement(By.xpath('//*[@id="postform-text"]')).sendKeys('Hello from WebDriver');
    await driver.findElement(By.xpath('//*[@id="w0"]/div[5]/div[1]/div[2]/div/span/span[1]/span')).click()
    await driver.findElement(By.xpath("//*[@id=\"select2-postform-expiration-results\"]/li[3]")).click();
    await driver.findElement(By.xpath('//*[@id="postform-name"]')).sendKeys('helloweb');

  finally {
    // await driver.quit();
  }
})();

The error message im getting:

ElementClickInterceptedError: element click intercepted: Element <span class="select2-selection select2-selection--single" role="combobox" aria-h
aspopup="true" aria-expanded="false" tabindex="0" aria-disabled="false" aria-labelledby="select2-postform-expiration-container">...</span> is not
 clickable at point (301, 605). Other element would receive the click: <iframe frameborder="0" src="https://5c552a9e567bcd9a4394df1b9acbfaaa.safe
frame.googlesyndication.com/safeframe/1-0-38/html/container.html" id="google_ads_iframe_/22653346938/12825_Pastebin.com/12825_Pastebin.com_SmartB
anner_1_0" title="3rd party ad content" name="" scrolling="no" marginwidth="0" marginheight="0" width="970" height="90" data-is-safeframe="true"
sandbox="allow-forms allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation-by-user-activation" role="r
egion" aria-label="Advertisement" tabindex="0" data-google-container-id="3" style="border: 0px; vertical-align: bottom;" data-load-complete="true
"></iframe>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use the below locator to click on Paste Expiration: dropdown

CSS_SELECTOR

#select2-postform-expiration-containe

After that to choose option 10 minutes you can use this locator

Xpath

//li[contains(.,'10 Minutes')]

I have tested this using Java and it's working for me.

In case you are unable to click on Paste Expiration: drop than use Actions method to move_to_element and click on it.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda