Friday, November 21, 2008

Selenium Core Playback in IE - HTA Mode

Selenium Core provides an additional mechanism for running automated tests called "HTA mode." HTA Mode only works on Windows, and only with Internet Explorer; you can't use HTA mode to test any other browser. An HTA file is a special type of HTML file that is allowed to violate the same origin policy and to write files to disk. When running in HTA mode, you don't have to install Selenium Core on the same webserver as the AUT. HTA files are also allowed to save test results directly to disk, rather than POSTing the test results to a webserver.

To run Selenium Core in HTA mode, just double-click on TestRunner.hta, in the /core directory of your Selenium installation. (As you can see, TestRunner.hta is just a copy of TestRunner.html; but that ".hta" extension makes a big difference!) You can then run your test suite just like any other Selenium Core test, but since the tests are being run in HTA mode, you're free to run your tests against any website.

You can also run TestRunner.hta from the command line, passing arguments to it just like you would pass arguments to an HTML file, like this:

C:\selenium\core>TestRunner.hta "test=..%2Ftests%2FTestSuite.html&auto=true&close=true&resultsUrl=results.html&save=true"

No comments: