public class FormHelper extends Object
| Constructor and Description |
|---|
FormHelper() |
| Modifier and Type | Method and Description |
|---|---|
void |
clearAndSetField(EnhancedBy field,
CharSequence... value)
clears and set field
|
void |
clearAndSetField(EnhancedBy field,
int index,
CharSequence... value)
clear and sets field
|
void |
formSubmit(EnhancedBy button,
EnhancedBy expected)
select submit button and wait for expected element to load
|
void |
formSubmit(EnhancedBy button,
EnhancedBy expected,
EnhancedBy spinner)
clicks submit button, wait for element to appear And loading spinner to be
removed
|
void |
formSubmitNoRetry(EnhancedBy button,
EnhancedBy expected)
submit form with retrying selecting the element
|
void |
formSubmitNoRetry(EnhancedBy button,
int index,
EnhancedBy expected)
submit form with retrying selecting the element
|
String |
getTextValue(EnhancedBy element)
gets the text value from an element
|
String |
getTextValue(EnhancedBy element,
int index)
gets the text value from an element
|
void |
pressEnterOnWeb(EnhancedBy field) |
void |
selectCheckBox(EnhancedBy button,
boolean isSelect)
selects checkbox based on by value
|
void |
selectDropDown(EnhancedBy field,
EnhancedBy list)
select drop down by index from the drop down list
|
void |
selectDropDown(EnhancedBy field,
int index,
EnhancedBy list,
int optionIndex)
select drop down field based on index
select option field based on index
|
void |
selectDropDown(EnhancedBy field,
int index,
EnhancedBy list,
String text)
select drop down field based on index
select option field based on text
|
void |
selectDropDown(int index,
EnhancedBy field,
EnhancedBy list)
select drop down by index from the drop down list
|
void |
selectDropDown(String option,
EnhancedBy field,
EnhancedBy list)
selects drop down
|
void |
selectDropDown(String option,
EnhancedBy field,
EnhancedBy list,
int listIndex)
select drop down based on index of the drop down list eg.
|
void |
selectDropDown(String option,
EnhancedBy field,
int index,
EnhancedBy list)
selects drop down based on index of the drop down field
|
void |
selectDropDown(String option,
EnhancedBy field,
int index,
EnhancedBy list,
int listIndex)
select drop down based on index of the drop down list eg.
|
void |
selectDropDown(String option,
EnhancedBy field,
String field_Identifier,
EnhancedBy list)
selects drop down from list defined by another list defined by text
|
void |
selectDropDownWithDoubleClick(String option,
EnhancedBy field,
EnhancedBy list)
selects dropdown by double clicking on the field
|
void |
selectDropDownWithDoubleClick(String option,
EnhancedBy field,
int index,
EnhancedBy list)
selects dropdown by double clicking on the field
|
void |
selectMultipleCheckboxOptions(List<String> selections,
EnhancedBy checkboxes)
selects multiple checkbox options
|
void |
selectRadioButton(EnhancedBy button)
selects a button
|
void |
selectRadioButton(String option,
EnhancedBy buttons)
selects radio button by radio button description
|
void |
selectToggle(EnhancedBy on,
EnhancedBy off,
boolean isOn)
select toggle button, on or off
|
void |
setField(EnhancedBy field,
CharSequence... value)
sets field clears field before setting the value
|
void |
setField(EnhancedBy field,
int index,
CharSequence... value)
sets and clears field before setting the value
|
void |
setField(String value,
EnhancedBy field,
int index)
sets field text value by index hides keyboard if on ios device
|
void |
setFieldAndEnter(EnhancedBy field,
CharSequence... value)
sets field And presses the enter key
|
void |
setFieldByAction(EnhancedBy field,
CharSequence... value)
sets and clears field before setting the value by actions
|
void |
setFieldByAction(EnhancedBy field,
int index,
CharSequence... value)
sets and clears field before setting the value by actions
|
void |
setFieldByJs(EnhancedBy field,
CharSequence... value)
set field through javascript
|
void |
setFieldByJs(EnhancedBy field,
int index,
CharSequence... value)
set field through javascript
|
void |
setKey(org.openqa.selenium.Keys key,
EnhancedBy field)
send
|
void |
setKeyChildField(EnhancedBy parent,
int parentIndex,
EnhancedBy child,
int childIndex,
CharSequence... value)
sets key based on nested text field
|
void |
uploadFile(String location,
EnhancedBy imageButton)
uploads file by specifying file location relative to main path
|
void |
uploadImage(String location,
EnhancedBy imageButton,
EnhancedBy images)
sets the image based on image path
|
void |
uploadImages(List<String> locations,
EnhancedBy imageButton,
EnhancedBy images)
* sets the image based on list of image path
|
public void clearAndSetField(EnhancedBy field, CharSequence... value)
field - value - public void clearAndSetField(EnhancedBy field, int index, CharSequence... value)
field - index - value - public void setField(EnhancedBy field, CharSequence... value)
field - value - public void setField(EnhancedBy field, int index, CharSequence... value)
field - index - value - public void setFieldByAction(EnhancedBy field, CharSequence... value)
field - index - value - public void setFieldByAction(EnhancedBy field, int index, CharSequence... value)
field - index - value - public void setFieldByJs(EnhancedBy field, CharSequence... value)
field - value - public void setFieldByJs(EnhancedBy field, int index, CharSequence... value)
field - index - value - public void setField(String value, EnhancedBy field, int index)
value - field - index - public void setKeyChildField(EnhancedBy parent, int parentIndex, EnhancedBy child, int childIndex, CharSequence... value)
parent - parentIndex - child - childIndex - value - public void setFieldAndEnter(EnhancedBy field, CharSequence... value)
field - value - public void setKey(org.openqa.selenium.Keys key,
EnhancedBy field)
key - field - public void pressEnterOnWeb(EnhancedBy field)
public void formSubmit(EnhancedBy button, EnhancedBy expected)
button - expected - public void formSubmitNoRetry(EnhancedBy button, EnhancedBy expected)
button - expected - public void formSubmitNoRetry(EnhancedBy button, int index, EnhancedBy expected)
button - index - expected - public void formSubmit(EnhancedBy button, EnhancedBy expected, EnhancedBy spinner)
button - expected - spinner - public void selectDropDownWithDoubleClick(String option, EnhancedBy field, EnhancedBy list)
option - field - list - public void selectDropDownWithDoubleClick(String option, EnhancedBy field, int index, EnhancedBy list)
option - field - list - public void selectDropDown(String option, EnhancedBy field, EnhancedBy list)
option - : list option we want to selectfield - : the drop down fieldlist - : the list items in the drop down listpublic void selectDropDown(String option, EnhancedBy field, String field_Identifier, EnhancedBy list)
option - field - field_Identifier - list - public void selectDropDown(int index,
EnhancedBy field,
EnhancedBy list)
index - field - list - public void selectDropDown(EnhancedBy field, int index, EnhancedBy list, int optionIndex)
field - index - list - optionIndex - public void selectDropDown(EnhancedBy field, int index, EnhancedBy list, String text)
field - index - list - text - public void selectDropDown(EnhancedBy field, EnhancedBy list)
index - field - list - public void selectDropDown(String option, EnhancedBy field, int index, EnhancedBy list)
option - field - index - list - public void selectDropDown(String option, EnhancedBy field, EnhancedBy list, int listIndex)
option - field - list - listIndex - public void selectDropDown(String option, EnhancedBy field, int index, EnhancedBy list, int listIndex)
option - field - index - list - listIndex - public void selectRadioButton(String option, EnhancedBy buttons)
option - buttons - public void selectCheckBox(EnhancedBy button, boolean isSelect)
button - isSelect - public void selectRadioButton(EnhancedBy button)
button - public void selectToggle(EnhancedBy on, EnhancedBy off, boolean isOn)
public void selectMultipleCheckboxOptions(List<String> selections, EnhancedBy checkboxes)
selections - checkboxes - public void uploadFile(String location, EnhancedBy imageButton)
location - imageButton - public void uploadImages(List<String> locations, EnhancedBy imageButton, EnhancedBy images)
locations - imageButton - images - public void uploadImage(String location, EnhancedBy imageButton, EnhancedBy images)
location - imageButton - images - : uploaded imagepublic String getTextValue(EnhancedBy element)
element - public String getTextValue(EnhancedBy element, int index)
element - Copyright © 2019. All rights reserved.