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

306
Views
WebdriverIO saucelabs bug, browser.getUrl is refer to started url but not for current url

I'm faced with issue when my tests on remote (CI+saucelabs or local machine + saucelabs remote) are not the similar.

I have a site (e.g. example.com)

My scenario consists on next steps:

  1. open example.com
  2. click to "login" button
  3. fill form and click to "sign in"
  4. forms redirect to another site (e.g. example2.com)
  5. proceed working with another site

inside the step 5 - browser.getUrl() should refers to example2.com (on local execution without saucelabs it's true), but on saucelabs I get example.com.

env:

nodejs: 16.13.1

npm: 8.1.2

libs:

@wdio/cli: 6.10.11

@wdio/sauce-service: 6.3.6

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

0

Without seeing more code it's hard to tell, but I suspect the problem is either timing related, or Selenium doing some weird caching.

(Sauce Labs acts as a proxy in this instance; It does nothing besides send commands to Selenium and relay responses back to your test runner.)

The network distance between a Sauce Labs browser and your SUT is going to be different than that between your local browsers and your SUT... especially if the SUT is located inside your corporate network. That makes me suspect there Sauce Labs browser may have to wait longer for your SUT to completely load, and the browser itself is telling Selenium it's on the wrong page still.

If you add a browser.waitUntil(browser.getUrl() === "desired_url", timeout), with a timeout of "30000", does your test start working? If so, it is a problem with the browser load time and you can either see what you can do to improve load time or just leave the wait in place.

I'd lower the timeout value after diagnosis though, to something more sensible.

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!