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

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

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 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