@Component
public class ClickingStepDefinitions
extends java.lang.Object
These steps have Atom snipptets that start with the prefix "click". See https://github.com/mcasperson/iridium-snippets for more details.
Constructor and Description |
---|
ClickingStepDefinitions() |
Modifier and Type | Method and Description |
---|---|
void |
clickCancelOnAlert(java.lang.String timesAlias,
java.lang.String times,
java.lang.String exists)
Clicks cancel on the alert
|
void |
clickElementSimpleStep(java.lang.String alias,
java.lang.String selectorValue,
java.lang.String timesAlias,
java.lang.String times,
java.lang.String exists)
A simplified step that will click on an element found by ID attribute, name attribute,
class attribute, xpath or CSS selector.
|
void |
clickElementStep(java.lang.String selector,
java.lang.String alias,
java.lang.String selectorValue,
java.lang.String timesAlias,
java.lang.String times,
java.lang.String exists)
Clicks on an element
|
void |
clickElementWithAttrStep(java.lang.String attributeNameAlias,
java.lang.String attributeName,
java.lang.String attributeValueAlias,
java.lang.String attributeValue,
java.lang.String timesAlias,
java.lang.String times,
java.lang.String exists)
Clicks an element on the page selected via its attributes
|
void |
clickElementWithRandomNumberStep(java.lang.String attributeNameAlias,
java.lang.String attributeName,
java.lang.String randomStartAlias,
java.lang.String randomStart,
java.lang.String randomEndAlias,
java.lang.String randomEnd,
java.lang.String timesAlias,
java.lang.String times,
java.lang.String exists)
Clicks on an element with a random number
|
void |
clickHiddenElementStep(java.lang.String selector,
java.lang.String alias,
java.lang.String selectorValue,
java.lang.String timesAlias,
java.lang.String times,
java.lang.String exists)
Clicks on an element that may or may not be visible on the page
|
void |
clickHiddenLinkStep(java.lang.String alias,
java.lang.String linkContent,
java.lang.String timesAlias,
java.lang.String times,
java.lang.String exists)
Clicks a link that may or may not be visible on the page
|
void |
clickInElement(java.lang.String event,
java.lang.Float xAxis,
java.lang.Float yAxis,
java.lang.String alias,
java.lang.String selectorValue,
java.lang.String timesAlias,
java.lang.String times,
java.lang.String exists)
Clicks within the area of an element.
|
void |
clickInObjElementSimpleStep(java.lang.String alias,
java.lang.String selectorValue,
java.lang.String objectAlias,
java.lang.String objectSelectorValue,
java.lang.String exists)
A simplified step that will click on an element within a SVG image embedded in an object element.
|
void |
clickLinkStep(java.lang.String alias,
java.lang.String linkContent,
java.lang.String timesAlias,
java.lang.String times,
java.lang.String exists)
Clicks a link on the page
|
void |
clickOKOnAlert(java.lang.String timesAlias,
java.lang.String times,
java.lang.String exists)
Clicks ok on the alert
|
void |
clickSimpleHiddenElementStep(java.lang.String alias,
java.lang.String selectorValue,
java.lang.String timesAlias,
java.lang.String times,
java.lang.String exists)
Selects an element with simplified selection and clicks on an it regardless of whether is
is or is not be visible on the page
|
void |
openInNewWindow(java.lang.String alias,
java.lang.String linkContent,
java.lang.String timesAlias,
java.lang.String times,
java.lang.String exists)
Opens a link in a new tab
|
@When(value="^I click (?:a|an|the)(?: element found by)?( alias)? \"([^\"]*)\"(?: \\w+)*? in the object element( alias)? \"([^\"]*)\"( if it exists)?$") public void clickInObjElementSimpleStep(java.lang.String alias, java.lang.String selectorValue, java.lang.String objectAlias, java.lang.String objectSelectorValue, java.lang.String exists)
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. This has
to resolve to an XPath.objectAlias
- If this word is found in the step, it means the objectSelectorValue is found from the
data set.objectSelectorValue
- The value used to find the object element holding the svg element.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 click (?:a|an|the)(?: element found by)?( alias)? \"([^\"]*)\"(?: \\w+)*?(?:( alias)? \"(.*?)\" times)?( if it exists)?$") public void clickElementSimpleStep(java.lang.String alias, java.lang.String selectorValue, java.lang.String timesAlias, java.lang.String times, java.lang.String exists)
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.timesAlias
- If this word is found in the step, it means the times is found from the
data set.times
- If this text is set, the click operation will be repeated the specified number of times.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 click (?:a|an|the) element with (?:a|an|the) (ID|class|xpath|name|css selector)( alias)? of \"([^\"]*)\"(?:( alias)? \"(.*?)\" times)?( if it exists)?$") public void clickElementStep(java.lang.String selector, java.lang.String alias, java.lang.String selectorValue, java.lang.String timesAlias, java.lang.String times, java.lang.String exists)
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.timesAlias
- If this word is found in the step, it means the times is found from the
data set.times
- If this text is set, the click operation will be repeated the specified number of times.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 click (?:a|an|the) hidden(?: element found by)?( alias)? \"([^\"]*)\"(?: \\w+)*?(?:( alias)? \"(.*?)\" times)?( if it exists)?$") public void clickSimpleHiddenElementStep(java.lang.String alias, java.lang.String selectorValue, java.lang.String timesAlias, java.lang.String times, java.lang.String exists)
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.timesAlias
- If this word is found in the step, it means the times is found from the
data set.times
- If this text is set, the click operation will be repeated the specified number of times.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 click (?:a|an|the) hidden element with (?:a|an|the) (ID|class|xpath|name|css selector)( alias)? of \"([^\"]*)\"(?:( alias)? \"(.*?)\" times)?( if it exists)?$") public void clickHiddenElementStep(java.lang.String selector, java.lang.String alias, java.lang.String selectorValue, java.lang.String timesAlias, java.lang.String times, java.lang.String exists)
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.timesAlias
- If this word is found in the step, it means the times is found from the
data set.times
- If this text is set, the click operation will be repeated the specified number of times.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 click (?:a|an|the) link with the text content of( alias)? \"([^\"]*)\"(?:( alias)? \"(.*?)\" times)?( if it exists)?$") public void clickLinkStep(java.lang.String alias, java.lang.String linkContent, java.lang.String timesAlias, java.lang.String times, java.lang.String exists)
alias
- If this word is found in the step, it means the linkContent is found from the data
set.linkContent
- The text content of the link we are clickingtimesAlias
- If this word is found in the step, it means the times is found from the
data set.times
- If this text is set, the click operation will be repeated the specified number of times.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 click (?:a|an|the) hidden link with the text content( alias)? of \"([^\"]*)\"(?:( alias)? \"(.*?)\" times)?( if it exists)?$") public void clickHiddenLinkStep(java.lang.String alias, java.lang.String linkContent, java.lang.String timesAlias, java.lang.String times, java.lang.String exists)
alias
- If this word is found in the step, it means the linkContent is found from the data
set.linkContent
- The text content of the link we are clickingtimesAlias
- If this word is found in the step, it means the times is found from the
data set.times
- If this text is set, the click operation will be repeated the specified number of times.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 click (?:a|an|the) element with (?:a|an|the) attribute( alias)? of \"([^\"]*)\" with a random number between( alias)? \"([^\"]*)\" and( alias)? \"([^\"]*)\"(?:( alias)? \"(.*?)\" times)?( if it exists)?$") public void clickElementWithRandomNumberStep(java.lang.String attributeNameAlias, java.lang.String attributeName, java.lang.String randomStartAlias, java.lang.String randomStart, java.lang.String randomEndAlias, java.lang.String randomEnd, java.lang.String timesAlias, java.lang.String times, java.lang.String exists)
attributeName
- Either ID, class, xpath, name or css selectorattributeNameAlias
- If this word is found in the step, it means the selectorValue is found
from the data set.randomStartAlias
- If this word is found in the step, it means the randomStart is found from the data
set.randomStart
- The start of the range of random numbers to select fromrandomEndAlias
- If this word is found in the step, it means the randomEnd is found from
the data set.randomEnd
- The end of the range of random numbers to select fromtimesAlias
- If this word is found in the step, it means the times is found from the
data set.times
- If this text is set, the click operation will be repeated the specified number of times.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 click (?:a|an|the) element with (?:a|an|the) attribute( alias)? of \"([^\"]*)\" equal to( alias)? \"([^\"]*)\"(?:( alias)? \"(.*?)\" times)?( if it exists)?$") public void clickElementWithAttrStep(java.lang.String attributeNameAlias, java.lang.String attributeName, java.lang.String attributeValueAlias, java.lang.String attributeValue, java.lang.String timesAlias, java.lang.String times, java.lang.String exists)
attributeNameAlias
- If this word is found in the step, it means the attributeName is found
from the data set.attributeName
- The name of the attribute to match.attributeValueAlias
- If this word is found in the step, it means the attributeValue is found
from the data set.attributeValue
- The value of the attribute to matchtimesAlias
- If this word is found in the step, it means the times is found from the
data set.times
- If this text is set, the click operation will be repeated the specified number of times.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 click \"OK\" on the alert(?:( alias)? \"(.*?)\" times)?( if it exists)?$") public void clickOKOnAlert(java.lang.String timesAlias, java.lang.String times, java.lang.String exists)
timesAlias
- If this word is found in the step, it means the times is found from the
data set.times
- If this text is set, the click operation will be repeated the specified number of times.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 click \"Cancel\" on the alert(?:( alias)? \"(.*?)\" times)?( if it exists)?$") public void clickCancelOnAlert(java.lang.String timesAlias, java.lang.String times, java.lang.String exists)
timesAlias
- If this word is found in the step, it means the times is found from the
data set.times
- If this text is set, the click operation will be repeated the specified number of times.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 \"(click|mousedown|mouseup|mouseover|mouseout|mousemove|dblclick)\" \"(\\d+(?:\\.\\d+)?)%\" horizontally and \"(\\d+(?:\\.\\d+)?)%\" vertically within the area of (?:a|an|the)(?: element found by)?( alias)? \"([^\"]*)\"(?: \\w+)*?(?:( alias)? \"(.*?)\" times)?( if it exists)?$") public void clickInElement(java.lang.String event, java.lang.Float xAxis, java.lang.Float yAxis, java.lang.String alias, java.lang.String selectorValue, java.lang.String timesAlias, java.lang.String times, java.lang.String exists)
event
- The kind of mouse event to triggerxAxis
- The horizontal percentage within the element area to clickyAxis
- The vertical percentage within the element area to clickalias
- Include this to force the selector to reference an aliasselectorValue
- The selectortimesAlias
- If this word is found in the step, it means the times is found from the
data set.times
- If this text is set, the click operation will be repeated the specified number of times.exists
- Include this to ignore errors caused by missing elements@When(value="^I open (?:a|an|the) link with the text content of( alias)? \"([^\"]*)\" in a new window(?:( alias)? \"(.*?)\" times)?( if it exists)?$") public void openInNewWindow(java.lang.String alias, java.lang.String linkContent, java.lang.String timesAlias, java.lang.String times, java.lang.String exists)
alias
- If this word is found in the step, it means the linkContent is found from
the data set.linkContent
- The text content of the link we are clickingtimesAlias
- If this word is found in the step, it means the times is found from the
data set.times
- If this text is set, the click operation will be repeated the specified number of times.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.