1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package net.sf.jameleon.plugin.selenium.tags;
20
21
22 /***
23 * Clicks on an HTML element.
24 *
25 * To click on a link with the text <b>Link 1</b>:
26 * <pre><source>
27 * <selenium-click
28 * functionId="Click on 'Link 1'"
29 * locator="link=Link 1" />
30 * </source></pre>
31 * To click on a submit button with the name <b>submit_name</b>:
32 * <pre><source>
33 * <selenium-click
34 * functionId="Click the submit button named 'submit_name'"
35 * locator="submit_name" />
36 * </source></pre>
37 * Refer to the Selenium javadocs for more information.
38 * @jameleon.function name="selenium-click" type="action"
39 */
40 public class SeleniumClickTag extends AbstractSeleniumLocatorTag{
41
42 /***
43 * The max number of milliseconds to wait for the page to load
44 * @jameleon.attribute
45 */
46 protected String waitForPageToLoad;
47
48 public void testBlock(){
49 session.click(locator);
50 if (waitForPageToLoad != null) {
51 session.waitForPageToLoad(waitForPageToLoad);
52 }
53 }
54 }