How to handle permission pop-ups with Appium & WebdriverIO on LambdaTest real devices?

How to handle permission pop-ups with Appium & WebdriverIO on LambdaTest real devices?

Hi Rebecca!

You can refer to the below test script for handling permission pop-ups while performing Appium testing with WebdriverIO -

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: "lt://", //Set your APP URL

      //GRANT PERMISSIONS FOR ANDROID
      autoGrantPermissions: true,

      //ACCEPT ALERTS FOR IOS
      autoAcceptAlerts : true,

      //DISMISS ALERTS FOR IOS
      autoDismissAlerts : false,
      
    },
  ],
  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 get started with handling permission pop-ups: