In order to run a test in a browser, that browser must be present on the computer running that test. For example if you have Internet Explorer 9 and you run an Internet Explorer test class, the test will execute in your installed version of Internet Explorer. For browsers like Firefox that allow you to have multiple installations on the same computer, it is possible to specify the exact executable to use as a part of the properties configuration.
Chrome
This library comes with the Chrome Web Driver used for Chrome on 32-bit Windows, but you can download any one you want from the project website here. To change the web driver in use, you just have to modify the location specified in properties file:
chrome.driver=drivers/chromedriver_win32_2.1/chromedriver.exe
To use Chrome specify it in the browsers action:
browsers Chrome
Firefox
This library uses Selenium, which comes with a Firefox web driver already present. You do however have the ability to optionally specify the Firefox executable to use in the in the project and/or build properties:
firefox.exe=C:\\Program Files\\Mozilla\\firefox.exe
To use Firefox specify it in the browsers action:
browsers Firefox
Safari
This library uses Selenium, which comes with a Safari web driver already present.
To use Safari specify it in the browsers action:
browsers Safari
Internet Explorer
This library comes with the Selenium Web Driver used for Internet Explorer on 32-bit Windows, but you can download any one you want from the project website here. To change the web driver in use, you just have to modify the location specified in project and/or build properties file:
ie.driver=drivers/IEDriverServer_Win32_2.35.3/IEDriverServer.exe
To use Internet Explorer specify it in the browsers action:
browsers InternetExplorer
HTML Unit
HtmlUnit is a “GUI-Less browser for Java programs”. It models HTML documents and provides an API that allows you to invoke pages, fill out forms, click links, etc… just like you do in your “normal” browser.
– http://htmlunit.sourceforge.net/
Since HTML Unit is supported within Selenium I went ahead and included within this library. However, while this is a more quick way to execute tests against HTML, that test is only a simulation. I have found that most complex HTML5 components such as with ExJS trees and grids do not work in HTML Unit. For example while the Firefox test in the real browser works, the Firefox simulated test though HTML Unit encounters JavaScript errors.
To use HTML Unit specify it in the browsers action:
browsers HtmlUnit
What Next?
See Actions