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

419
Vistas
Bootstrap Modal Dialog Disappears upon clicking in automation (Selenium)

I am using Selenium to automate a website interaction through ChromeDriver and .NET C#. The website contains a bootstrap modal dialog as seen in the screen shot. Clicking on the company name in each row will download the company profile PDF document (a child browser window will open for the download).

Human interaction with the website works perfectly. Also, if I run $("div.modal-dialog table>tbody>tr>td")[2].firstElementChild.click(); in Chrome's dev tool console, it also downloads the PDF properly.

But running this line of code in Selenium like this (IJavaScriptExecutor)driver).ExecuteScript(@"$(""div.modal-dialog table>tbody>tr>td"")[2].firstElementChild.click();"); will cause the modal dialog to disappear immediately and no PDF is downloaded.

Selenium is able to find the element at $("div.modal-dialog table>tbody>tr>td")[2].firstElementChild, which I tested in the code, so I'm pretty sure.

I think the automation process is clicking in the main window, not on the modal dialog, causing the latter to disappear immediately. But how to switch to a bootstrap modal popup in Selenium?

Or is it some other problem? Any thoughts? This issue is driving me nuts. Thank you very much in advance.

enter image description here

about 4 years ago · Juan Pablo Isaza
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