public class FormElement extends RunOnFailureKeywordsAdapter
| Modifier and Type | Field and Description |
|---|---|
protected Element |
element
Instantiated Element keyword bean
|
protected Logging |
logging
Instantiated Logging keyword bean
|
| Constructor and Description |
|---|
FormElement() |
| Modifier and Type | Method and Description |
|---|---|
void |
checkboxShouldBeSelected(String locator)
Verify the checkbox identified by locator is selected/checked.
|
void |
checkboxShouldNotBeSelected(String locator)
Verify the checkbox identified by locator is not selected/checked.
|
void |
chooseFile(String locator,
String filePath)
Types the given filePath into the input field identified by
locator.
|
void |
clickButton(String locator)
Click on the button identified by locator.
|
protected org.openqa.selenium.WebElement |
getCheckbox(String locator) |
protected List<org.openqa.selenium.WebElement> |
getRadioButtons(String groupName) |
protected org.openqa.selenium.WebElement |
getRadioButtonWithValue(String groupName,
String value) |
protected String |
getValueFromRadioButtons(List<org.openqa.selenium.WebElement> elements) |
void |
inputPassword(String locator,
String text)
Types the given text into the password field identified by
locator.
|
void |
inputText(String locator,
String text)
Types the given text into the text field identified by
locator.
|
protected void |
inputTextIntoTextField(String locator,
String text) |
protected boolean |
isFormElement(org.openqa.selenium.WebElement element) |
void |
pageShouldContainButton(String locator) |
void |
pageShouldContainButton(String locator,
String message) |
void |
pageShouldContainButton(String locator,
String message,
String logLevel)
Verify the button identified by locator is found on the current
page.
|
void |
pageShouldContainCheckbox(String locator) |
void |
pageShouldContainCheckbox(String locator,
String message) |
void |
pageShouldContainCheckbox(String locator,
String message,
String logLevel)
Verify the checkbox identified by locator is found on the current
page.
|
void |
pageShouldContainRadioButton(String locator) |
void |
pageShouldContainRadioButton(String locator,
String message) |
void |
pageShouldContainRadioButton(String locator,
String message,
String logLevel)
Verify the radio button identified by locator is found on the
current page.
|
void |
pageShouldContainTextfield(String locator) |
void |
pageShouldContainTextfield(String locator,
String message) |
void |
pageShouldContainTextfield(String locator,
String message,
String logLevel)
Verify the text field identified by locator is found on the
current page.
|
void |
pageShouldNotContainButton(String locator) |
void |
pageShouldNotContainButton(String locator,
String message) |
void |
pageShouldNotContainButton(String locator,
String message,
String logLevel)
Verify the button identified by locator is not found on the
current page.
|
void |
pageShouldNotContainCheckbox(String locator) |
void |
pageShouldNotContainCheckbox(String locator,
String message) |
void |
pageShouldNotContainCheckbox(String locator,
String message,
String logLevel)
Verify the checkbox identified by locator is not found on the
current page.
|
void |
pageShouldNotContainRadioButton(String locator) |
void |
pageShouldNotContainRadioButton(String locator,
String message) |
void |
pageShouldNotContainRadioButton(String locator,
String message,
String logLevel)
Verify the radio button identified by locator is not found on the
current page.
|
void |
pageShouldNotContainTextfield(String locator) |
void |
pageShouldNotContainTextfield(String locator,
String message) |
void |
pageShouldNotContainTextfield(String locator,
String message,
String logLevel)
Verify the text field identified by locator is not found on the
current page.
|
void |
radioButtonShouldBeSetTo(String groupName,
String value)
Verify the radio button group identified by groupName has its
selection set to value.
|
void |
radioButtonShouldNotBeSelected(String groupName)
Verify the radio button group identified by groupName has no
selection.
|
void |
selectCheckbox(String locator)
Select the checkbox identified by locator.
|
void |
selectRadioButton(String groupName,
String value)
Sets the selection of the radio button group identified by
groupName to value.
|
void |
submitForm() |
void |
submitForm(String locator)
Submit the form identified by locator.
|
void |
textareaShouldContain(String locator,
String text) |
void |
textareaShouldContain(String locator,
String text,
String message)
Verify the text area identified by locator contains text.
|
void |
textareaShouldNotContain(String locator,
String text) |
void |
textareaShouldNotContain(String locator,
String text,
String message)
Verify the text area identified by locator does not contain text.
|
void |
textareaValueShouldBe(String locator,
String text) |
void |
textareaValueShouldBe(String locator,
String text,
String message)
Verify the text area identified by locator is exactly
text.
|
void |
textareaValueShouldNotBe(String locator,
String text) |
void |
textareaValueShouldNotBe(String locator,
String text,
String message)
Verify the text area identified by locator is not exactly
text.
|
void |
textfieldShouldContain(String locator,
String text) |
void |
textfieldShouldContain(String locator,
String text,
String message)
Verify the text field identified by locator contains text.
|
void |
textfieldShouldNotContain(String locator,
String text) |
void |
textfieldShouldNotContain(String locator,
String text,
String message)
Verify the text field identified by locator does not contain
text.
|
void |
textfieldValueShouldBe(String locator,
String text) |
void |
textfieldValueShouldBe(String locator,
String text,
String message)
Verify the text field identified by locator is exactly
text.
|
void |
textfieldValueShouldNotBe(String locator,
String text) |
void |
textfieldValueShouldNotBe(String locator,
String text,
String message)
Verify the text field identified by locator is not exactly
text.
|
void |
unselectCheckbox(String locator)
Unselect the checkbox identified by locator.
|
runOnFailureByAspectJprotected Element element
protected Logging logging
public void submitForm()
public void submitForm(String locator)
locator - Default=NONE. The locator to locate the form.public void checkboxShouldBeSelected(String locator)
locator - The locator to locate the checkbox.public void checkboxShouldNotBeSelected(String locator)
locator - The locator to locate the checkbox.public void pageShouldContainCheckbox(String locator)
public void pageShouldContainCheckbox(String locator, String message, String logLevel)
locator - The locator to locate the checkbox.message - Default=NONE. Optional custom error message.logLevel - Default=INFO. Optional log level.public void pageShouldNotContainCheckbox(String locator)
public void pageShouldNotContainCheckbox(String locator, String message)
public void pageShouldNotContainCheckbox(String locator, String message, String logLevel)
locator - The locator to locate the checkbox.message - Default=NONE. Optional custom error message.logLevel - Default=INFO. Optional log level.public void selectCheckbox(String locator)
locator - The locator to locate the checkbox.public void unselectCheckbox(String locator)
locator - The locator to locate the checkbox.public void pageShouldContainRadioButton(String locator)
public void pageShouldContainRadioButton(String locator, String message)
public void pageShouldContainRadioButton(String locator, String message, String logLevel)
locator - The locator to locate the radio button.message - Default=NONE. Optional custom error message.logLevel - Default=INFO. Optional log level.public void pageShouldNotContainRadioButton(String locator)
public void pageShouldNotContainRadioButton(String locator, String message)
public void pageShouldNotContainRadioButton(String locator, String message, String logLevel)
locator - The locator to locate the radio button.message - Default=NONE. Optional custom error message.logLevel - Default=INFO. Optional log level.public void radioButtonShouldBeSetTo(String groupName, String value)
groupName - The radio button group name.value - The expected value.public void radioButtonShouldNotBeSelected(String groupName)
groupName - The radio button group name.public void selectRadioButton(String groupName, String value)
| Select Radio Button | size | XL | # Matches HTML like <input type="radio" name="size" value="XL">XL</input> |
| Select Radio Button | size | sizeXL | # Matches HTML like <input type="radio" name="size" value="XL" id="sizeXL">XL</input> |
groupName - The radio button group name.value - The value or id attribute of the radio button to set.public void chooseFile(String locator, String filePath)
| Choose File | my_upload_field | /home/user/files/trades.csv |
locator - The locator to locate the input field.filePath - The file path to inputpublic void inputPassword(String locator, String text)
locator - The locator to locate the password field.text - The password to inputpublic void inputText(String locator, String text)
locator - The locator to locate the text field.text - The password to inputpublic void pageShouldContainTextfield(String locator)
public void pageShouldContainTextfield(String locator, String message, String logLevel)
locator - The locator to locate the text field.message - Default=NONE. Optional custom error message.logLevel - Default=INFO. Optional log level.public void pageShouldNotContainTextfield(String locator)
public void pageShouldNotContainTextfield(String locator, String message)
public void pageShouldNotContainTextfield(String locator, String message, String logLevel)
locator - The locator to locate the text field.message - Default=NONE. Optional custom error message.logLevel - Default=INFO. Optional log level.public void textfieldValueShouldBe(String locator, String text, String message)
locator - The locator to locate the text field.text - The text to verify.message - Default=NONE. Optional custom error message.textfieldShouldContain(java.lang.String, java.lang.String),
textfieldShouldNotContain(java.lang.String, java.lang.String),
textfieldValueShouldNotBe(java.lang.String, java.lang.String)public void textfieldValueShouldNotBe(String locator, String text, String message)
locator - The locator to locate the text field.text - The text to verify.message - Default=NONE. Optional custom error message.textfieldShouldContain(java.lang.String, java.lang.String),
textfieldShouldNotContain(java.lang.String, java.lang.String),
textfieldValueShouldBe(java.lang.String, java.lang.String)public void textfieldShouldContain(String locator, String text, String message)
locator - The locator to locate the text field.text - The text to verify.message - Default=NONE. Optional custom error message.textfieldShouldNotContain(java.lang.String, java.lang.String),
textfieldValueShouldBe(java.lang.String, java.lang.String),
textfieldValueShouldNotBe(java.lang.String, java.lang.String)public void textfieldShouldNotContain(String locator, String text, String message)
locator - The locator to locate the text field.text - The text to verify.message - Default=NONE. Optional custom error message.textfieldShouldContain(java.lang.String, java.lang.String),
textfieldValueShouldBe(java.lang.String, java.lang.String),
textfieldValueShouldNotBe(java.lang.String, java.lang.String)public void textareaShouldContain(String locator, String text, String message)
locator - The locator to locate the text area.text - The text to verify.message - Default=NONE. Optional custom error message.textareaShouldNotContain(java.lang.String, java.lang.String),
textareaValueShouldBe(java.lang.String, java.lang.String),
textareaValueShouldNotBe(java.lang.String, java.lang.String)public void textareaShouldNotContain(String locator, String text, String message)
locator - The locator to locate the text area.text - The text to verify.message - Default=NONE. Optional custom error message.textareaShouldContain(java.lang.String, java.lang.String),
textareaValueShouldBe(java.lang.String, java.lang.String),
textareaValueShouldNotBe(java.lang.String, java.lang.String)public void textareaValueShouldBe(String locator, String text, String message)
locator - The locator to locate the text area.text - The text to verify.message - Default=NONE. Optional custom error message.textareaShouldContain(java.lang.String, java.lang.String),
textareaShouldNotContain(java.lang.String, java.lang.String),
textareaValueShouldNotBe(java.lang.String, java.lang.String)public void textareaValueShouldNotBe(String locator, String text, String message)
locator - The locator to locate the text area.text - The text to verify.message - Default=NONE. Optional custom error message.textareaShouldContain(java.lang.String, java.lang.String),
textareaShouldNotContain(java.lang.String, java.lang.String),
textareaValueShouldBe(java.lang.String, java.lang.String)public void clickButton(String locator)
locator - The locator to locate the link.public void pageShouldContainButton(String locator)
public void pageShouldContainButton(String locator, String message, String logLevel)
locator - The locator to locate the button.message - Default=NONE. Optional custom error message.logLevel - Default=INFO. Optional log level.public void pageShouldNotContainButton(String locator)
public void pageShouldNotContainButton(String locator, String message, String logLevel)
locator - The locator to locate the button.message - Default=NONE. Optional custom error message.logLevel - Default=INFO. Optional log level.protected org.openqa.selenium.WebElement getCheckbox(String locator)
protected org.openqa.selenium.WebElement getRadioButtonWithValue(String groupName, String value)
protected String getValueFromRadioButtons(List<org.openqa.selenium.WebElement> elements)
protected boolean isFormElement(org.openqa.selenium.WebElement element)
Copyright © 2014. All rights reserved.