Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

265
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!