/** * @dtf.feature Selenium Formatter * @dtf.feature.group Selenium * * @dtf.feature.desc * <p> * 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. * </p> * <p> * 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. * </p> * <p> * 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: * </p> * * <br/> * <center> * <table border="1"> * <tr><th>Selenium Command</th><th>DTF XML Representation</th></tr> * <tr> * <td>assertElementPresent(xxx)</td> * <td> * <verbatim> * <assert><isElementPresent locator="xxx"/></assert> * </verbatim> * </td> * </tr> * <tr> * <td>assertTextPresent(xxx)</td> * <td> * <verbatim> * <assert><isTextPresent pattern="xxx"/></assert> * </verbatim> * </td> * </tr> * <tr> * <td>clickAndWait(xxx)</td> * <td> * <verbatim> * <click locator="xxx"/> * <br/> * <waitForPageToLoad timeout="default timeout from options"/> * </verbatim> * </td> * </tr> * <tr> * <td>verifyTitle(xxx)</td> * <td> * <verbatim> * <getTitle property="sel.gettitle-[unique id]"/> * <br/> * <assert><eq op1="${dtf.sel.gettitle-[unique id]}" op2="xxx"/></assert> * </verbatim> * </td> * </tr> * <tr> * <td>waitForTextPresent(xxx)</td> * <td> * <verbatim> * <while> * <br/> * <not><isTextPresent pattern="xxx"/></not> * <br/> * <sleep time="1s"/> * <br/> * </while> * </verbatim> * </td> * </tr> * <tr> * <td>waitForElementPresent(xxx)</td> * <td> * <verbatim> * <while> * <br/> * <not><isElementPresent locator="xxx"/></not> * <br/> * <sleep time="1s"/> * <br/> * </while> * </verbatim> * </td> * </tr> * <tr> * <td>waitForTitle(xxx)</td> * <td> * <verbatim> * <while> * <br/> * <not><isElementPresent locator="xxx"/></not> * <br/> * <sleep time="1s"/> * <br/> * </while> * </verbatim> * </td> * </tr> * </table> * </center> * </p> */ public class DTFFormatter { /* * Dummy class used to house DTF XML Documentation for selenium formatter. */ }