Package dev.comfast.cf.se
Class SeleniumLocator
java.lang.Object
dev.comfast.cf.CfAbstractLocator
dev.comfast.cf.se.SeleniumLocator
- All Implemented Interfaces:
CfLocator
- Direct Known Subclasses:
FoundElement
-
Field Summary
Fields inherited from class dev.comfast.cf.CfAbstractLocator
chain -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSeleniumLocator(SelectorChain chain) SeleniumLocator(String selector, Object... params) -
Method Summary
Modifier and TypeMethodDescriptionget sub-locator related to current onevoidclear()Clear given input/textarea/select/checkboxvoidclick()Click on elementintcount()protected ObjectdoExecuteJs(String script, Object... args) voidDrag current element onto other elementExecutes JavaScript code, where "this" is current elementbooleanexists()protected org.openqa.selenium.WebElementfind()voidfocus()Focus on element using JSgetAttribute(String name) getCssValue(String name) voidhover()Hover mouse on elementboolean<T> List<T>Does mapping against each element found by locatornth(int nth) nth element found by locatorvoidsetChecked(boolean state) Check/uncheck checkboxvoidGeneric set value of element.voidtap()Tap gesture on elementprotected Optional<org.openqa.selenium.WebElement>tryFind()voidType keys into elementMethods inherited from class dev.comfast.cf.CfAbstractLocator
action, action, canEqual, equals, getText, getValue, hasClass, hashCode, innerHtml, outerHtml, toString
-
Constructor Details
-
SeleniumLocator
-
SeleniumLocator
-
-
Method Details
-
$
Description copied from interface:CfLocatorget sub-locator related to current one -
getAttribute
- Specified by:
getAttributein interfaceCfLocator- Returns:
- javascript attribute of element
-
getCssValue
- Specified by:
getCssValuein interfaceCfLocator- Parameters:
name- eg. color, opacity, etc.- Returns:
- css value of given name
-
getTagName
- Specified by:
getTagNamein interfaceCfLocator- Returns:
- html tag name
-
exists
public boolean exists() -
isDisplayed
public boolean isDisplayed()- Specified by:
isDisplayedin interfaceCfLocator- Returns:
- true if element is visible, not throw if element not found - just return false
-
tap
public void tap()Description copied from interface:CfLocatorTap gesture on element -
click
public void click()Description copied from interface:CfLocatorClick on element -
focus
public void focus()Description copied from interface:CfLocatorFocus on element using JS -
hover
public void hover()Description copied from interface:CfLocatorHover mouse on element -
dragTo
Description copied from interface:CfLocatorDrag current element onto other element -
setValue
Description copied from interface:CfLocatorGeneric set value of element. Should work on input, textarea, select, etc. -
setChecked
public void setChecked(boolean state) Description copied from interface:CfLocatorCheck/uncheck checkbox- Specified by:
setCheckedin interfaceCfLocator- Parameters:
state- true- check, false - uncheck
-
clear
public void clear()Description copied from interface:CfLocatorClear given input/textarea/select/checkbox -
type
Description copied from interface:CfLocatorType keys into element -
count
public int count() -
nth
Description copied from interface:CfLocatornth element found by locator -
executeJs
Description copied from interface:CfLocatorExecutes JavaScript code, where "this" is current element -
map
Description copied from interface:CfLocatorDoes mapping against each element found by locator -
doExecuteJs
-
find
protected org.openqa.selenium.WebElement find() -
tryFind
-