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 to Switch to iFrame with webdriverio 4.13.1

I am trying to switch to an iframe that has dynamic name and id with static start for both of these attributes, I tried the function browser.frame(''); as follow:

  let frameSelector = $('.zoid-visible');
  const frameID = frameSelector.getAttribute("id");
  console.log("frameID = "+frameID );
  const frameLocator = '#'+frameID +'';
  console.log("frameLocator = "+frameLocator);
  let my_frame = $(frameLocator).value;
  browser.frame(my_frame);

but it throws an error as follows:

invalid selector: Unable to locate an element with the xpath expression //input[#'search-text'] because of the following error:     
SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//input[#'search-text']' is not a valid XPath expression.

Following is the chunk of DOM I am trying to interact with:

<iframe allowtransparency="true" name="__zoid__one_component__eyJ1aWQidFwibmFtZV3RcIn19fSJ9__" title="one_component" id="uid_eabf27beee_mty6ndi6ndi" class="zoid-visible" style="background-color: transparent; border: none;"></iframe>

I tried all the available resources and couldn't find a solution, any help would be appreciated. Thank you.

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