└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # How to add geolocation to an automation test in UnitTest on [LambdaTest](https://www.lambdatest.com/?utm_source=github&utm_medium=repo&utm_campaign=UnitTest-geolocation) 2 | 3 | If you want to run your automation test for a particular location in UnitTest on Lambdatest, you can use the following steps. You can refer to sample test repo [here](https://github.com/LambdaTest/Python-UnitTest-Selenium). 4 | 5 | # Steps: 6 | 7 | To run your automation test from a particular location to test location based functionality, you can change the geolocation using the 'geolocation' capability: 8 | 9 | ```python 10 | desired_caps = { 11 | 'LT:Options': { 12 | "build": "Python Demo", # Change your build name here 13 | "name": "Python Demo Test", # Change your test name here 14 | "platformName": "Windows 11", 15 | "selenium_version": "4.0.0", 16 | "geoLocation": "US" 17 | }, 18 | "browserName": "Chrome", 19 | "browserVersion": "98.0", 20 | } 21 | 22 | ``` 23 | 24 | For the full list of available geolocations, you can refer [here](https://www.lambdatest.com/support/docs/selenium-automation-capabilities/#selenium-automation-testing-from-different-geolocations). 25 | 26 | ## Run your test 27 | 28 | ```bash 29 | python lambdatest_test.py 30 | ``` 31 | 32 | # Links: 33 | 34 | [LambdaTest Community](http://community.lambdatest.com/) 35 | 36 | --------------------------------------------------------------------------------