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

127
Visualizações
How do I create testcafe selector element when the iframe has only src?

I have a following iframe section which i would like to use for further actions

    <div class="addonWrapper"><div class="detailhead mobileonly">   
    <div class="cancelbtn cancelmobileiframebtn" title="Zurück" onclick="closeMobileIFrame()"></div></div>
    <iframe src="https://abcd.php?stage=1&amp;access_token=zrhrhha8b-621bb319cd38d-1348650f57bf2b8d70fbc84d95b747ab" style="width: 100%; height: 100%; border: none;"></iframe>
    </div>

i have tried to do something like this.

this.iframeM = Selector('iframe').withAttribute(
            'src',
            'https://abcd.php?stage=1&amp;access_token=zrhrhha8b-621bb319cd38d-1348650f57bf2b8d70fbc84d95b747ab'
        );

then in the test

await t.switchToIframe(mPage.iframeM);

But its not successful. I keep getting the error "The specified selector does not match any element in the DOM tree.!"

What is the best way to identify the iframe in this case where only src is available. Help would be deeply appreciated.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Can you try following ?

  1. Use regular expression instead of the exact value of the attribute

https:\/\/abcd.php\?stage=1.*


this.iframeM = Selector('iframe').withAttribute(
            'src',/https:\/\/abcd.php\?stage=1.*/
        );

Reference : Selector with .withAttribute Method

  1. Increase the timeout value for iFrame Reference : Increase the timeout value for the iFrame

  2. Run the test in debug mode Run the test in debug mode and execute the iFrame specific code when the frame is loaded.

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