You can get the value to compare against several ways, and use it several ways. None of them use Selenium, which is just a library that interacts with web pages.
Your tests will always be run from the same location and you are using IP address geolocation
This is the simplest situation. You do an internet search and find your location, then use that as a comparison constant for your test.
Your tests will always be run from the same location and your application is using something other than IP address
This is a little more complex, because the most common online geolocation sites I found in a quick search use your IP address to get a location. You might have to run a few searches to find the geolocation if your application uses something different - such as address, postal code, address plus postal code, etc. You will still end up with a geolocation you can use as a constant for your tests.
Your tests use a different location each time
This is the complicated scenario. To get the location that's being used, you're going to need to use one of the geolocation APIs to get the actual location. Most of them come with instructions on how to use them, but if you're not familiar with programming you'll find this challenging.
If this is what you need to do, I'd recommend creating a separate class to handle the API interaction so that all your tests need to do is use whatever the location is based on in your app - let's say it's IP address - and call the geolocation class.