View Javadoc

1   /*
2       Jameleon Watij plug-in - A plug-in that uses Watij (http://www.watij.com/) to drive web sites
3       Copyright (C) 2008 Christian W. Hargraves (engrean@hotmail.com)
4   
5       This program is free software; you can redistribute it and/or modify
6       it under the terms of the GNU General Public License as published by
7       the Free Software Foundation; either version 2 of the License, or
8       (at your option) any later version.
9   
10      This program is distributed in the hope that it will be useful,
11      but WITHOUT ANY WARRANTY; without even the implied warranty of
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13      GNU General Public License for more details.
14  
15      You should have received a copy of the GNU General Public License
16      along with this program; if not, write to the Free Software
17      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  
19  */
20  package net.sf.jameleon.plugin.watij.tags;
21  
22  import watij.elements.HtmlElement;
23  import watij.finders.Symbol;
24  
25  /***
26   * Gets a select list on the page and stores in the context.
27   * 
28   * <pre><source>
29   * &lt;testcase xmlns="jelly:jameleon" xmlns:j="jelly:core"&gt;
30   *     &lt;watij-session baseUrl="http://some.url/some/path" beginSession="true"&gt;
31   *         &lt;watij-select-list
32   *             functionId="Gets a select list"
33   *             how="xpath"
34   *             what="//SELECT[@name='server_name']/OPTION[contains(text(), 'MWI')]" 
35   *             select="true/false"/>
36   *     &lt;/watij-session&gt;
37   * &lt;/testcase&gt;
38   * </source></pre>
39   * 
40   * See the javadocs on watij's {@link  watij.finders.SymbolFactory SymbolFactory} for a complete list of supported symbols.
41   * @jameleon.function name="watij-select-list-option" type="action"
42   */
43  public class WatijSelectListOptionTag extends AbstractWatijGetTag {
44  
45      public HtmlElement getHtmlElement(Symbol how, String what) throws Exception{
46          return ie().option(how, what);
47      }
48  
49      public String getTagName(){
50          return "Option Select List";
51      }
52  }