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

135
Vistas
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 Respuestas
Responde la pregunta

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