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

248
Views
How to apply waitForExist() on two selector simultaneously in webDriverIO

Currently, I am upgrading the WebDriverIo version from 4 to 5 wherein one of the existing tests we are applying waitForExist on two selectors simultaneously. In v4 it's like this .waitForExist(selector + loadingSelector, null, true) But in V5 waitForExist chaining to selector and therefore I've refactored this to await (sel1+loadingSelector).waitForExist(0,true,null); but this throwing error `TypeError: (selector + loadingSelector).waitForExist is not a function

Here is my bit of command code:

addIdeCommand('ideOpenFolder', async function (folder, treeCls, fuzzy) {
    var sel1 =await browser.$(sel1);
    var loadSelector = await browser.$(sel2);
    

        await sel1.waitForDisplayed();
        // Wait for the loading icon to disappear (true = not exists)
       **await (selector+loadSelector).waitForExist(0,true,null);**
        await this.waitUntil(async function () {
            //something
        });
});

Can someone please help me with how to apply waitForExisting() on multiple selectors at the same time?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You could use Promise.all:

await Promise.all([
  method1,
  method2,
  ...
])
about 4 years ago · Juan Pablo Isaza Report
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!