I have some Selenium RC tests (written in PHP) testing an application in a sandbox where users need to type in their physical addresses. Addresses have to be real, otherwise application displays an error message. I'd like the scripts to input a new real US address every time the test runs. Any ideas how to implement this? Thanks!
-
1why different addresses on each test - you just need a bunch of addresses (extreme short/extreme long) that will pass or fail the test as you want it. – Del Pedro Sep 05 '12 at 20:31
-
100 West 1st street ... 101 West 1st street ... 102 West 1st street ... – Tina CG Hoehr Sep 05 '12 at 21:05
2 Answers
Get a batch of fake names and addresses at: Fake Name Generator.
Process the list through a CASS-Certified service such as LiveAddress for Lists. This will identify all the real and valid US addresses that happened to be generated.
Extract only the valid addresses (see the simple-mailable file that comes with the download) for your testing purposes.
If you generate a few thousand random addresses on that website, you should get plenty of valid ones to test with, purely by chance.
I do work at SmartyStreets, and this is how we get "fake" data for showcasing our service or for help and instructional purposes (without exposing actual private information).

- 1,048,767
- 296
- 4,058
- 3,343

- 22,721
- 17
- 71
- 112
-
2I did this exact thing, starting with a list of 1million addresses and then ended up with almost 5k valid addresses. If you need more than that, obviously you could just get a few different lists from fakenamegenerator and process them all. SmartyStreets only charges for the valid addresses so you wouldn't be paying for millions of addreses, but for 5k addresses per list. Hope that helps. – Jeffrey Sep 05 '12 at 22:12
-
1This seems like a reasonably easy and inexpensive way to do it. I'll just need my tests to parse the CSV file and chose an address at random. – Stan Sarber Sep 06 '12 at 23:43
-
Unfortunately it seems this doesn't work with french addresses. Out of 10000 random addresses, no one were considered "valid" by LiveAddress. – Olivier Pons Sep 29 '13 at 22:17
-
1@OlivierPons Right. The SmartyStreets homepage is clear to mention that it validates USPS addresses (US and its territories). – Matt Sep 30 '13 at 00:30
-
@OlivierPons SmartyStreets now offers international address verification – camiblanch Aug 12 '15 at 16:40
-
you can do that using the following steps: 1- select a random place from google-maps (choose it wisely, you don't want to choose a place too close to the water ).
2- get the latitude and longitude of that location.
3- generate random numbers( small ones, very small ones, both positive and negative) and add them to the selected latitude and longitude.
4- using google-maps api, you can retrieve addresses close to that position.
5- repeat for every random latitude and longitude -- and now you have automated the task.

- 2,563
- 2
- 28
- 32
-
Google Maps will interpolate to give you values for addresses that don't exist, unfortunately... That comes in handy sometimes, but not in this case when the addresses need to be real. – Matt Sep 05 '12 at 21:21