net.sf.jameleon.plugin.jiffie.tags
Class IEFireEventTag
java.lang.Object
org.apache.commons.jelly.TagSupport
net.sf.jameleon.LocationAwareTagSupport
net.sf.jameleon.JameleonTagSupport
net.sf.jameleon.function.FunctionTag
net.sf.jameleon.plugin.jiffie.IEFunctionTag
net.sf.jameleon.plugin.jiffie.tags.IEFireEventTag
All Implemented Interfaces: BreakPoint , Attributable , DocumentDelegate , Storable , DynaTag , LocationAware , Tag
Direct Known Subclasses: IEClickButtonTag , IEClickHtmlElementTag , IESetCheckboxTag , IESetPasswordFieldTag , IESetRadiobuttonTag , IESetSelectFieldTag , IESetTextAreaTag , IESetTextFieldTag
public class IEFireEventTag extends IEFunctionTag
Fires event methtods in a provided HTML element.
This element can be anything that can hold an onxxx call like a a button,
an image, or even just some element like a text field.
Some example uses might be:
Firing a onmouseover event from <input type="image" onmouseover="mouseOver('largeLizard.jpg')"
onmouseout="mouseOut('smallLizard.jpg')" src="smallLizard.jpg">
<ie-fire-event functionId="Call the onmouseover event in the image button with the src ending in smallLizard.jpg"
eventToFire="onmouseover"
htmlElement="input">
<ie-attribute>
<ie-attribute-name>type</ie-attribute-name>
<ie-attribute-value>image</ie-attribute-value>
</ie-attribute>
<ie-attribute>
<ie-attribute-name>src</ie-attribute-name>
<ie-attribute-value>smallLizard.jpg</ie-attribute-value>
</ie-attribute>
</ie-fire-event>
Fires the onclick event on <a href="/some/path/helloWorld.html" onclick="alert('somemessage')">
based on the href text alone
<ie-fire-event functionId="Click a url with the href ending in helloWorld.html"
eventToFire="onclick"
htmlElement="a">
<ie-attribute>
<ie-attribute-name>href</ie-attribute-name>
<ie-attribute-value>helloWorld.html</ie-attribute-value>
</ie-attribute>
</ie-fire-event>
Fires the onchange event on a text field <input type="text" name="textname" id="text_id" > with a name and an id
<ie-fire-event functionId="Fire onchange event on a text field with a name, and an id"
htmlElement="input"
eventToFire="onchange">
<ie-attribute>
<ie-attribute-name>type</ie-attribute-name>
<ie-attribute-value>text</ie-attribute-value>
</ie-attribute>
<ie-attribute>
<ie-attribute-name>name</ie-attribute-name>
<ie-attribute-value>textname</ie-attribute-value>
</ie-attribute>
<ie-attribute>
<ie-attribute-name>id</ie-attribute-name>
<ie-attribute-value>text_id</ie-attribute-value>
</ie-attribute>
</ie-fire-event>
Use XPath to fire the onchange event a text field in a form:
<form name="formname" action="dosomething.php" method="post">
First Name: <input type="text" name="first_name" >
</form>
<ie-fire-event functionId="Fire onchange event on a text field with a name"
xpath="//FORM[@name='formname']/INPUT[@type='text' and @name='first_name']"/>
Tag Name : <ie-fire-event> Type : action
Steps:
Find an element the the provided attribute names and values.
Fire the given HTML event.
Field Summary
protected String
eventToFire
The name of the javascript event to fire on the form element.
protected String
htmlElement
The html element type to click on.
protected String
xpath
The XPath used to indentify the desired object.
Fields inherited from class net.sf.jameleon.function.FunctionTag
addt , breakPoint , expectException , expectFailure , fResults , functionDelay , functionId , lastFileWritten , log , NO_DELAY , params , postcondition , precondition , st , state , tct , vpt
Methods inherited from class net.sf.jameleon.plugin.jiffie.IEFunctionTag
activateBrowserWithIndex , activateBrowserWithTitle , activateLastNewWindow , assertCheckboxChecked , assertCheckboxChecked , assertCheckboxChecked , assertCheckboxChecked , assertCheckboxWithNameAndValueChecked , assertCheckboxWithNameAndValueChecked , assertCheckboxWithNameAndValueChecked , assertCheckboxWithNameAndValueChecked , assertLinkPresent , assertLinkPresent , assertLinkPresent , assertLinkPresent , assertLinkWithHrefPresent , assertLinkWithHrefPresent , assertPasswordFieldValueEquals , assertPasswordFieldValueEquals , assertPasswordFieldValueEquals , assertPasswordFieldValueEquals , assertRadioButtonChecked , assertRadioButtonChecked , assertRadioButtonChecked , assertRadioButtonChecked , assertSelectFieldOptionIndexEquals , assertSelectFieldOptionIndexEquals , assertSelectFieldOptionIndexEquals , assertSelectFieldOptionIndexEquals , assertSelectFieldOptionIndexesEqual , assertSelectFieldOptionIndexesEqual , assertSelectFieldOptionIndexesEqual , assertSelectFieldOptionIndexesEqual , assertSelectFieldOptionTextEquals , assertSelectFieldOptionTextEquals , assertSelectFieldOptionTextEquals , assertSelectFieldOptionTextEquals , assertSelectFieldOptionTextValuesEqual , assertSelectFieldOptionTextValuesEqual , assertSelectFieldOptionTextValuesEqual , assertSelectFieldOptionTextValuesEqual , assertSelectFieldOptionValueEquals , assertSelectFieldOptionValueEquals , assertSelectFieldOptionValueEquals , assertSelectFieldOptionValueEquals , assertSelectFieldOptionValuesEqual , assertSelectFieldOptionValuesEqual , assertSelectFieldOptionValuesEqual , assertSelectFieldOptionValuesEqual , assertTextAreaValueEquals , assertTextAreaValueEquals , assertTextAreaValueEquals , assertTextAreaValueEquals , assertTextFieldValueEquals , assertTextFieldValueEquals , assertTextFieldValueEquals , assertTextFieldValueEquals , assertTextNotPresent , assertTextNotPresent , assertTextNotPresent , assertTextNotPresent , assertTextPresent , assertTextPresent , assertTextPresent , assertTextPresent , assertTextPresent , assertTitleEquals , assertTitleEquals , assertTitleEquals , assertTitleEquals , assertTitleEquals , assertTitleEquals , assertTitleEquals , assertTitleNotEquals , assertTitleNotEquals , assertTitleNotEquals , assertTitleNotEquals , assertXPath , assertXPathResultsSizeEquals , assertXPathResultsSizeEquals , clearSelectFieldValues , clickIHTMLElement , clickImageLinkWithAltText , clickLink , clickLink , clickLink , clickLinkWithHref , clickLinkWithId , clickLinkWithImageSrc , clickLinkWithText , clickSubmitButtonWithName , closeBrowserWindow , closeBrowserWindow , fireEvent , getAreaElementByAltText , getByXPath , getCheckbox , getCheckboxWithNameAndValue , getDocument , getElementByXPath , getElementsByXPath , getForm , getFormWithId , getFormWithIndex , getFormWithName , getFormWithXPath , getFrameWithId , getFrameWithName , getFrameWithSrc , getHiddenField , getHTMLSource , getIHTMLElement , getIHTMLElement , getIHTMLElement , getIHTMLElement , getIHTMLElements , getIHTMLElements , getIHTMLElements , getIHTMLElements , getImageLinkWithAltText , getInputFieldByName , getLink , getLinksWith , getLinkWith , getLinkWithHref , getLinkWithID , getLinkWithImageSrc , getLinkWithName , getPasswordField , getRadioButton , getSelectedOptionField , getSelectField , getSubmit , getSubmit , getSubmitButtonWithName , getSubmitButtonWithNameAndValue , getSubmitButtonWithValue , getTextArea , getTextField , getWorkingForm , highlightActiveElement , isTextInPage , navigate , navigate , pluginTearDown , setCheckbox , setCheckboxWithNameAndValue , setHiddenFieldValue , setPasswordFieldValue , setRadioButtonValue , setSelectFieldOptionIndex , setSelectFieldOptionIndexes , setSelectFieldOptionText , setSelectFieldOptionTextValues , setSelectFieldOptionValue , setSelectFieldOptionValues , setTextAreaValue , setTextFieldValue , setTextFieldValue , setupEnvironment , setWorkingForm , setWorkingForm , setWorkingFormById , setWorkingFormByIndex , setWorkingFormByName , store , submitWorkingForm
Methods inherited from class net.sf.jameleon.function.FunctionTag
addParam , addRequiredAttribute , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertEquals , assertFalse , assertFalse , assertFalse , assertFalse , assertMethod , assertMethodWithLevel , assertNotNull , assertNotNull , assertNotNull , assertNotNull , assertNotSame , assertNotSame , assertNotSame , assertNotSame , assertNull , assertNull , assertNull , assertNull , assertRegexMatches , assertRegexMatches , assertRegexMatches , assertRegexMatches , assertSame , assertSame , assertSame , assertSame , assertTextContains , assertTextContains , assertTextContains , assertTextContains , assertTextEndsWith , assertTextEndsWith , assertTextEndsWith , assertTextEndsWith , assertTextStartsWith , assertTextStartsWith , assertTextStartsWith , assertTextStartsWith , assertTrue , assertTrue , assertTrue , assertTrue , checkParamTypes , cleanUp , cleanUpEnvironment , delay , delay , doTag , fail , fail , fail , fail , getFunctionId , getFunctionResults , getMatchingRegexText , getParam , getParamLength , getParams , getParentTags , getSessionTag , getStoreToFileName , getStringOrDefault , getTestCaseTag , getVariable , getVariableAsBoolean , getVariableAsList , getVariableAsString , isBreakPoint , isContextVariableNull , recordFunctionResult , regexMatches , removeFunctionResult , removeVariable , setDefaultVariableValue , setDefaultVariableValue , setExpectException , setExpectFailure , setFunctionDelay , setFunctionId , setup , setUpFunctionResults , setVariable , tearDown , traceMsg , validate
Methods inherited from class net.sf.jameleon.JameleonTagSupport
cleanVariablesInContext , createAttributes , describeAttributes , getAttributeBroker , getAttributes , getAttributeType , getClassAttributes , getFunctionalPoint , getUnsupportedAttributes , loadFunctionalPoint , resetFunctionalPoint , setAttribute , setVariableInContext , testForUnsupportedAttributesCaught
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass , findAncestorWithClass , findAncestorWithClass , findAncestorWithClass , findAncestorWithClass , findAncestorWithClass , getBody , getBodyText , getBodyText , getContext , getParent , invokeBody , isEscapeText , isTrim , setBody , setContext , setEscapeText , setParent , setTrim , trimBody
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
htmlElement
protected String htmlElement
The html element type to click on. For example, for <input type="submit" >
this would be set to input . Either htmlElement or xpath must be set.
This attribute is recognized by Jameleon
xpath
protected String xpath
The XPath used to indentify the desired object. Either use this
or the name and value tags. Either htmlElement or xpath must be set.
This attribute is recognized by Jameleon
eventToFire
protected String eventToFire
The name of the javascript event to fire on the form element.
This attribute is recognized by Jameleon
IEFireEventTag
public IEFireEventTag ()
testBlock
public void testBlock ()
Overrides: testBlock in class FunctionTag
getElementToFireEvent
protected IHTMLElement getElementToFireEvent ()
setAttributes
protected void setAttributes ()
Translates the param objects to an array of strings for names and values.
addParameter
protected void addParameter (String name,
String value,
String type)
A helper method for those action points which extend this class.
Parameters: name - - The name of the attributevalue - - The value of the attribute
fireEvent
public void fireEvent (IHTMLElement element)
Copyright © 2004-2008 Christian Hargraves. All Rights Reserved.