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

266
Views
ElementClickInterceptedError: clic de elemento interceptado. Selenio Javascript Chromedriver

Tengo problemas para hacer clic en un elemento de un menú desplegable. Lo que tengo que hacer es:

  1. Abra https://pastebin.com
  2. pegar "Hola desde WebDriver"
  3. Establezca Pegar caducidad en "10 minutos"
  4. Establezca Pegar título en "helloweb"

Sin embargo, después de abrir el menú desplegable, parte del contenido de anuncios de terceros no me permite hacer clic en mi botón, lo que resulta en ElementClickInterceptedError

Aquí está mi código

 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(); } })();

El mensaje de error que estoy recibiendo:

 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

Puede usar el localizador a continuación para hacer clic en Pegar caducidad: menú desplegable

CSS_SELECTOR

 #select2-postform-expiration-containe

Después de eso, para elegir la opción 10 minutos , puede usar este localizador

Xpath

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

He probado esto usando Java y está funcionando para mí.

En caso de que no pueda hacer clic en Pegar caducidad: suéltelo y luego use el método Actions para move_to_element y haga clic en él.

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!