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

252
Vistas
How to play a video inside an iframe using selenium with node.js?

I'm trying to play a video inside an <iframe> using selenium with node.js. I have tried

`driver.sleep("2000");
await driver.switchTo().frame(0);
let playVideo = By.id("shakaVid");
// await driver.switchTo().frame(driver.findElement(playVideo));
await driver.wait(until.elementLocated(playVideo), 15*1000);
await driver.findElement(playVideo).play();`

I'm getting TimeoutError: Waiting for element to be located By(css selector, *[id="shakaVid"]) I have also tried By.css("iframe html > body > video") but none of these are working. And I don't know how to test that selenium is shifting its focus to iframe. So, I have tried multiple things.

This is how my html is : Elements

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Looks like that's not the first frame, try giving web element for iframe instead of indexing:

let iframe = By.cssSelector("iframe[name^='vdoFrame'][src*='playerAssets']");
await driver.switchTo().frame(driver.findElement(iframe));

if this css selector iframe[id^='vdoFrame'][src*='playerAssets'] is locating the right iframe (Please verify that in element section when we inspect), then you should be able to switch to iframe and rest of your code should work just fine.

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