This is an old revision of the document!
Selenium Plugin
Selenium plugin provides a set of MScript functions to perform test automation on your web application. Just like other plugins, you can enable it for each model and can be used with other plugins together except SeqOut Plugin.
Plugin Overview
Selenium plugin uses Selenium to drive your web applications with real browser in real-time as model is executing. You can use either mscript or java to call Selenium2/WebDriver to drive your web applications. MScript is an xml-based scripting and Selenium plugin provides a rich set of MScript Functions.
Selenium supports various browsers to test your web applications as well as a simulated browser through HtmlUnit which offers much higher performance. This is more suited for running load testing when you need to simulate hundreds or thousands of users running models simultaneously.
Chrome Config & Custom Profile
You can config Google Chrome browser by setting webdriver.properties. You may need to config this plugin using the information provided in the links below:
To set up Chrome browser to use a custom profile, edit webdriver.properties and add/update the following setting:
profile.chrome.loc=/path/to/your/custom/profile
For more information about Chrome Driver, please refer to Chrome Driver User Documentation
WebDriver Config
You may also configure Selenium/WebDriver by setting webdriver.properties file. See example webdriver.properties.
By default 32 bit IE driver is used, however you can change this default to 64 bit IE driver by editing webdriver.properties file. Alternatively you can call Selenium function $setCapabilityString() to dynamically change which IE driver to be used to launch AUT:
$Selenium.setCapabilityString('driver.IE','IEDriverServer_64BIT.exe') or $Selenium.setCapabilityString('driver.IE','IEDriverServer_32BIT.exe')
Firefox Custom Profile
This section assumes that you already has created a custom profile using Firefox Profile Manager. If not, following the instruction at How to Create Firefox Profile.
You may use custom Firefox profile by setting profile.firefox.loc in webdriver.properties to point to the location/folder where your custom profile is stored:
profile.firefox.loc=C:/path/to/my/filefox/profile
Alternatively you can also set this during model execution in MBT_start trigger:
<action lid="9" code="$Selenium.setCapabilityString('profile.firefox.loc','C:/path/to/my/filefox/profile')"/>
Element Locator
Need help with element locator? Check out Michael Sorens' post on Selenium locator: