How to set Geolocation in an automation test with Mocha.js on LambdaTest cloud?

How to set geolocation in an automation test with Mocha.js on LambdaTest cloud?

Hi Alex,

In order to set geolocation with Mocha.js on LambdaTest cloud, you can refer to these following steps. You can also refer to the sample test repo:

In conf/single.conf.js file, you need to update your capabilities. You can change the geolocation using the ‘geolocation’ capability: :

exports.capabilities = {
    'build': 'Mocha-Selenium-Sample', //Build name
    'name': 'Your Test Name', // Test name
    'platform':'Windows 10', // OS name
    'browserName': 'chrome', // Browser name
    'version': 'latest', // Browser version
    'visual': false,  // To take step by step screenshot
    'network':false,  // To capture network Logs
    'console':false, // To capture console logs.
    'tunnel': false, // If you want to run the localhost than change it to true
    'geolocation': 'US'
  }
};

Here’s the GitHub repo for the same: https://github.com/rshmimondal/Mocha-js-geolocation