I am trying to use selenium to run tests; There seems to be no good way to run the same set of unit tests in multiple browsers.
I read this post about running tests in parallel:
http://slmoloch.blogspot.com/2009/12/design-of-selenium-tests-for-aspnet_19.html
However, I use the visual studio testing infrastructure.
I can create a proxy class as follows:
public class SeleniumProxy {
private List<DefaultSelenium> targets;
public SeleniumProxy() {
targets = new List<DefaultSelenium>();
targets.Add(new DefaultSelenium(... "firefox"...));
targets.Add(new DefaultSelenium(... "iexplore"...));
}
public void Open(String url) {
foreach (var i in targets) {
i.Open(url);
}
}
...
}
My question is this? How can I do this without rewriting the entire class as a proxy?
I thought that maybe I passed lamda in to match the arguments or passed a function that takes the name of the method to call, but it all seems like pretty lame ideas.
I really want to add a member, for example:
public class SeleniumProxy {
public dynamic proxy;
....
}
And call it like:
var selenium = getProxy();
selenium.proxy.Open("...");
# ?
- - , - ?
:
-, ?
(: ... DefaultSelenium - ..?)