Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

267
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda