Wednesday, September 16, 2009

Launching WatiN via Web Service

We recently encountered a requirement whereby we need to automate a process in a 3rd party web application which does not currently have any available API's. We have toyed with WatiN for automated testing, so we thought why not make use of it for automating a process via the web application front-end.

We need to trigger the WatiN code via an ASMX Web Service, however you may know WatiN uses COM to automate IE and therefore requires use of STA, where as ASMX uses MTA (STA vs MTA).

A quick Google with Bing resolved the problem using Running ASMX Web Services on STA Threads. Hopefully this will help out others in a similar situation.

No comments: