org.kuali.hr.util
Class HtmlUnitUtil
java.lang.Object
org.kuali.hr.util.HtmlUnitUtil
public class HtmlUnitUtil
- extends Object
Method Summary |
static com.gargoylesoftware.htmlunit.html.HtmlPage |
clickAnchorContainingText(com.gargoylesoftware.htmlunit.html.HtmlPage page,
String... values)
|
static com.gargoylesoftware.htmlunit.html.HtmlPage |
clickButton(com.gargoylesoftware.htmlunit.html.HtmlPage page,
String name)
|
static com.gargoylesoftware.htmlunit.html.HtmlPage |
clickClockInOrOutButton(com.gargoylesoftware.htmlunit.html.HtmlPage page)
|
static com.gargoylesoftware.htmlunit.html.HtmlPage |
clickInputContainingText(com.gargoylesoftware.htmlunit.html.HtmlPage page,
String... values)
|
static com.gargoylesoftware.htmlunit.html.HtmlPage |
clickLunchInOrOutButton(com.gargoylesoftware.htmlunit.html.HtmlPage page,
String lunchAction)
|
static void |
createTempFile(com.gargoylesoftware.htmlunit.html.HtmlPage page)
|
static void |
createTempFile(com.gargoylesoftware.htmlunit.html.HtmlPage page,
String name)
|
protected static boolean |
elementContainsValues(com.gargoylesoftware.htmlunit.html.HtmlElement element,
String... values)
|
static com.gargoylesoftware.htmlunit.html.HtmlPage |
fillOutForm(com.gargoylesoftware.htmlunit.html.HtmlPage page,
Map<String,Object> criteria)
|
static com.gargoylesoftware.htmlunit.html.HtmlAnchor |
getAnchorContainingText(com.gargoylesoftware.htmlunit.html.HtmlPage page,
String... values)
|
static com.gargoylesoftware.htmlunit.html.HtmlForm |
getDefaultForm(com.gargoylesoftware.htmlunit.html.HtmlPage htmlPage)
|
static com.gargoylesoftware.htmlunit.html.HtmlInput |
getInputContainingText(com.gargoylesoftware.htmlunit.html.HtmlForm form,
String text)
|
static com.gargoylesoftware.htmlunit.html.HtmlInput |
getInputContainingText(com.gargoylesoftware.htmlunit.html.HtmlPage page,
String... values)
|
static List<com.gargoylesoftware.htmlunit.html.HtmlInput> |
getInputsContainingText(com.gargoylesoftware.htmlunit.html.HtmlPage page,
String... values)
|
static String |
getOnClickHref(com.gargoylesoftware.htmlunit.html.HtmlElement button)
Method to obtain the HREF onclick='' value from the button when
the client side typically processes the request. |
static com.gargoylesoftware.htmlunit.html.HtmlPage |
gotoPageAndLogin(com.gargoylesoftware.htmlunit.WebClient webClient,
String url)
|
static com.gargoylesoftware.htmlunit.html.HtmlPage |
gotoPageAndLogin(com.gargoylesoftware.htmlunit.WebClient webClient,
String url,
boolean enableJavascript)
|
static boolean |
pageContainsText(com.gargoylesoftware.htmlunit.html.HtmlPage page,
String text)
|
static void |
setFieldValue(com.gargoylesoftware.htmlunit.html.HtmlPage page,
String fieldId,
String fieldValue)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HtmlUnitUtil
public HtmlUnitUtil()
gotoPageAndLogin
public static com.gargoylesoftware.htmlunit.html.HtmlPage gotoPageAndLogin(com.gargoylesoftware.htmlunit.WebClient webClient,
String url)
throws Exception
- Parameters:
url
-
- Returns:
- htmlpage without js enabled
- Throws:
Exception
gotoPageAndLogin
public static com.gargoylesoftware.htmlunit.html.HtmlPage gotoPageAndLogin(com.gargoylesoftware.htmlunit.WebClient webClient,
String url,
boolean enableJavascript)
throws Exception
- Parameters:
url
- enableJavascript
-
- Returns:
- htmlpage with js enabled
- Throws:
Exception
pageContainsText
public static boolean pageContainsText(com.gargoylesoftware.htmlunit.html.HtmlPage page,
String text)
fillOutForm
public static com.gargoylesoftware.htmlunit.html.HtmlPage fillOutForm(com.gargoylesoftware.htmlunit.html.HtmlPage page,
Map<String,Object> criteria)
throws Exception
- Parameters:
page:
- current html pagecriteria:
- The key is the field name and the value is a string array which contains the field value and the field type which can be chosen from TkTestConstants
- Returns:
- HtmlPage resultPage
- Throws:
Exception
getOnClickHref
public static String getOnClickHref(com.gargoylesoftware.htmlunit.html.HtmlElement button)
- Method to obtain the HREF onclick='' value from the button when
the client side typically processes the request.
- Parameters:
button
-
clickButton
public static com.gargoylesoftware.htmlunit.html.HtmlPage clickButton(com.gargoylesoftware.htmlunit.html.HtmlPage page,
String name)
throws Exception
- Parameters:
page:
- current html page //NOTE doesnt seem to work currently for js setting of form variablesname:
- the button name
- Returns:
-
- Throws:
Exception
clickClockInOrOutButton
public static com.gargoylesoftware.htmlunit.html.HtmlPage clickClockInOrOutButton(com.gargoylesoftware.htmlunit.html.HtmlPage page)
throws Exception
- Throws:
Exception
clickLunchInOrOutButton
public static com.gargoylesoftware.htmlunit.html.HtmlPage clickLunchInOrOutButton(com.gargoylesoftware.htmlunit.html.HtmlPage page,
String lunchAction)
throws Exception
- Throws:
Exception
clickInputContainingText
public static com.gargoylesoftware.htmlunit.html.HtmlPage clickInputContainingText(com.gargoylesoftware.htmlunit.html.HtmlPage page,
String... values)
throws Exception
- Throws:
Exception
getInputContainingText
public static com.gargoylesoftware.htmlunit.html.HtmlInput getInputContainingText(com.gargoylesoftware.htmlunit.html.HtmlPage page,
String... values)
throws Exception
- Throws:
Exception
setFieldValue
public static final void setFieldValue(com.gargoylesoftware.htmlunit.html.HtmlPage page,
String fieldId,
String fieldValue)
getInputsContainingText
public static List<com.gargoylesoftware.htmlunit.html.HtmlInput> getInputsContainingText(com.gargoylesoftware.htmlunit.html.HtmlPage page,
String... values)
throws Exception
- Throws:
Exception
elementContainsValues
protected static boolean elementContainsValues(com.gargoylesoftware.htmlunit.html.HtmlElement element,
String... values)
clickAnchorContainingText
public static com.gargoylesoftware.htmlunit.html.HtmlPage clickAnchorContainingText(com.gargoylesoftware.htmlunit.html.HtmlPage page,
String... values)
throws Exception
- Throws:
Exception
getAnchorContainingText
public static com.gargoylesoftware.htmlunit.html.HtmlAnchor getAnchorContainingText(com.gargoylesoftware.htmlunit.html.HtmlPage page,
String... values)
throws Exception
- Throws:
Exception
createTempFile
public static void createTempFile(com.gargoylesoftware.htmlunit.html.HtmlPage page)
throws Exception
- Throws:
Exception
createTempFile
public static void createTempFile(com.gargoylesoftware.htmlunit.html.HtmlPage page,
String name)
throws Exception
- Throws:
Exception
getInputContainingText
public static com.gargoylesoftware.htmlunit.html.HtmlInput getInputContainingText(com.gargoylesoftware.htmlunit.html.HtmlForm form,
String text)
throws Exception
- Throws:
Exception
getDefaultForm
public static com.gargoylesoftware.htmlunit.html.HtmlForm getDefaultForm(com.gargoylesoftware.htmlunit.html.HtmlPage htmlPage)
Copyright © 2004-2013 The Kuali Foundation. All Rights Reserved.