@Component
public class FocusStepDefinitions
extends java.lang.Object
Constructor and Description |
---|
FocusStepDefinitions() |
Modifier and Type | Method and Description |
---|---|
void |
focusElementStep(java.lang.String alias,
java.lang.String selectorValue,
java.lang.String exists)
Focuses on an element.
|
void |
focusElementStep(java.lang.String selector,
java.lang.String alias,
java.lang.String selectorValue,
java.lang.String exists)
Focuses on an element.
|
@When(value="^I focus(?: on)? (?:a|an|the) element found by( alias)? \"([^\"]*)\"( if it exists)?$") public void focusElementStep(java.lang.String alias, java.lang.String selectorValue, java.lang.String exists)
Often with text fields that have some kind of mask you need to first focus on the element before populating it, otherwise you might not enter all characters correctly.
alias
- If this word is found in the step, it means the selectorValue is found from the
data set.selectorValue
- The value used in conjunction with the selector to match the element. If alias was
set, this value is found from the data set. Otherwise it is a literal value.exists
- If this text is set, an error that would be thrown because the element was not
found is ignored. Essentially setting this text makes this an optional statement.@When(value="^I focus(?: on)? (?:a|an|the) element with (?:a|an|the) (ID|class|xpath|name|css selector)( alias)? of \"([^\"]*)\"( if it exists)?$") public void focusElementStep(java.lang.String selector, java.lang.String alias, java.lang.String selectorValue, java.lang.String exists)
Often with text fields that have some kind of mask you need to first focus on the element before populating it, otherwise you might not enter all characters correctly.
selector
- Either ID, class, xpath, name or css selectoralias
- If this word is found in the step, it means the selectorValue is found from the
data set.selectorValue
- The value used in conjunction with the selector to match the element. If alias was
set, this value is found from the data set. Otherwise it is a literal value.exists
- If this text is set, an error that would be thrown because the element was not
found is ignored. Essentially setting this text makes this an optional statement.