views:

108

answers:

1

This is quite a straight forward question that I can't seem to find a comprehensive answer for. When using Selenium and Selenium proxy, how I can make the proxy catch outgoing xhr requests to specific uri's and modify the destination to a pre-mocked alternative. I found this example form googling, http://www.sonatype.com/people/2009/10/selenium-part-4/ but it doesn't seem to explain how to write the mockHelper methods...

Thanks

Simon

A: 

This would require modification to the proxy server. There are no means otherwise to muck around with the response bodies. Your two options are to modify the proxy in the Selenium RC distribution, or alternatively, provide your own proxy server elsewhere. You can have the Selenium proxy connect to your proxy or you can configure the browsers to connect directly to your proxy. This would allow you to configure squid or whatever your comfortable with to deal with the request.

nirvdrum