The Selenium formatter is a simple formatter that outputs DTF Selenium XML code that allows you to repeat your currently recorded browser interaction on other browsers.
When using this formatter you can pick to generate a full fledged DTF script or just generate a function that can be easily copied into your own test or even a library script to be imported by various tests. The best thing to do with this function is to then parameterize it as well as to document as to what it does in terms of a user behavior. Basically, describe the steps that were done in the selenium interaction so that you can start putting together different user scenarios that can be used in conjunction in different ways to replicate different user interaction scenarios.
Not all of the commands generated by the Selenium Firefox plugin are directly mapped to a selenium method call. In some cases the command involves additional logic to be done with some existing selenium method. The resulting XML has to convert a few selenium IDE commands into DTF XML code and the mappings look like so:
Selenium Command | DTF XML Representation |
---|---|
assertElementPresent(xxx) |
|
assertTextPresent(xxx) |
|
clickAndWait(xxx) |
<waitForPageToLoad timeout="default timeout from options"/> |
verifyTitle(xxx) |
<assert><eq op1="${dtf.sel.gettitle-[unique id]}" op2="xxx"/></assert> |
waitForTextPresent(xxx) |
<not><isTextPresent pattern="xxx"/></not> <sleep time="1s"/> </while> |
waitForElementPresent(xxx) |
<not><isElementPresent locator="xxx"/></not> <sleep time="1s"/> </while> |
waitForTitle(xxx) |
<not><isElementPresent locator="xxx"/></not> <sleep time="1s"/> </while> |