Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi All, I am trying to perform some functional testing on a particular website.

Basically, users can visit the website from different countries. And based upon the location of the user, the site displays relevant information. The webserver uses an external software that does the client IP to country mapping.

My question is, how do I simulate the GET requests to this server from the varied locations/country ? One solution that comes to my mind is to use free http proxies in various countries and write custom code using say LWP module for making the requests routed from the proxies.

The difficulty I am facing with this approach is that the current list of web proxies I could find from google do not work with a simple GET/POST form for submitting the URL to the proxy. So automation is not easy. Instead they work with some additional headers such as the cookies and it gets quite cumbersome figuring out the logic for each of the free proxy's URL form logic. To add to the problem, the free proxies are online only for a few hours.

Did people have had any similar experiences? Any advice/feedback would be very helpful.

Gracias, Decebel

  • Comment on [DUP] Effective request simulation from various location

Replies are listed 'Best First'.
Re: Effective request simulation from various location
by JavaFan (Canon) on Nov 03, 2008 at 01:30 UTC
    Assuming you have some control over the testing environment, just make your test server part of a network that has whatever IP address range you want to simulate. In the simplest case, you give an interface of your webserver an extra address - an address normaly situated in the country you want to test, and said address to access the webserver.

    Note however that using IP addresses to determine which country a person lives is in quite unreliable. People may use proxies located in a different country (specially when using the internet from their work location). Or just because they are a webcafe in country X doesn't mean they don't want the info from their country of residence.

    It's even worse if the website decides to adapt the language based on IP number, which no obvious way to reset it. google is an example of bad behaviour in that aspect.