Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

126
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!