Question: I'm trying to write a batched instrumentation test (using `ActivityInstrumentationTestCase2`) for a particular `Activity` where I change the intent each time the test runs. I can do this with a single test, and just loop through stopping and restarting the Activity with the new intent, but this is not what I want. One reason is they really should be separate test runs. The other reason is, I'm using [Spoon](https://github.com/square/spoon) to generate a report when the tests finish, and the report will rightly think I only ran one test.

What I would like is it to treat a single test as a possibly infinite number of tests, and pass the data into the test each time the test runs. 

Unfortunately you can't use [Theories](https://blogs.oracle.com/jacobc/entry/junit_theories) because it results in a RuntimeException where the InstrumentationTestRunner can't find my tests. Anyone have any luck with this?

Answer: 
A postback-based system (.NET, Prado/PHP, etc) works in a manner that it keeps a complete snapshot of the browser contents on the server side. This is called a pagestate. Any attempt to manipulate with a client that is not JavaScript-capable is almost sure to fail.

What you need is a JavaScript-capable browser. The easiest solution I found is to use the framework Firefox is written in - [XUL](https://developer.mozilla.org/en/docs/XUL) - to create such a desktop application. What you do is basically create a desktop application with a single browser element in it, which you can then script from the application itself without restrictions of the security container. Alternatively, you could also use the [Greasemonkey plugin](https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/) to do your bidding. The latter is a bit easier to get started with, but it's fairly limited since it's running on a per-page basis.

With both solutions you then have access to the page's DOM to gather data and you can also fire events (like clicking on a button). Unfortunately you have to learn JavaScript for this to work.
As well as Selenium, you can use <http://watin.org/>