How to change IP geographic location with Appium WebdriverIO on real devices?

How to change IP geographic location with Appium WebdriverIO on real devices?

Hi Noah!

To change IP geolocation for Appium testing with WebdriverIO, you need to add geoLocation capability in your test script.

You can refer to the below code snippet -

exports.config = {
  user: process.env.LT_USERNAME || "YOUR_USERNAME",
  key: process.env.LT_ACCESS_KEY || "YOUR_ACCESS_KEY",
  updateJob: false,
  specs: ["./../specs/android-test.js"],
  exclude: [],
  capabilities: [
    {
      build: "NodeJS WebDriverIO Android",
      name: "Sample Test - WebDriverIO",
      isRealMobile: true,
      platformName: "Android",
      deviceName: "Galaxy S9",
      platformVersion: "10",
      app: "YOUR_APP_URL", //Set your APP URL
      
      //ADD GEOLOCATION BASED ON COUNTRY CODE
      geoLocation: "fr"  
    },
  ],
  logLevel: "info",
  coloredLogs: true,
  screenshotPath: "./errorShots/",
  baseUrl: "",
  waitforTimeout: 10000,
  connectionRetryTimeout: 90000,
  connectionRetryCount: 3,
  path: "/wd/hub",
  hostname: "mobile-hub.lambdatest.com",
  port: 80,
  framework: "mocha",
  mochaOpts: {
    ui: "bdd",
    timeout: 20000,
  },
};

Here is the sample GitHub repo to help you start Geolocation testing using Appium WebdriverIO.