public class Similo
extends java.lang.Object
Constructor and Description |
---|
Similo(WebDriver webDriver)
Create a MultiLocator associated with Selenium WebDriver.
|
Similo(WebDriver webDriver,
java.lang.String propertiesFolder)
Create a MultiLocator associated with Selenium WebDriver and a folder containing locator properties.
|
Similo(WebDriver webDriver,
java.lang.String propertiesFolder,
java.lang.String javascriptFilename)
Create a MultiLocator associated with Selenium WebDriver, a locator folder, and a Javascript file.
|
Modifier and Type | Method and Description |
---|---|
boolean |
check(java.io.File file,
java.lang.String validExpression)
Find and checks a WebElement using adaptive and self-healing multi-locators.
|
boolean |
check(java.util.Properties properties,
java.lang.String validExpression)
Find and checks a WebElement using adaptive and self-healing multi-locators.
|
boolean |
check(java.lang.String fileName,
java.lang.String validExpression)
Find and checks a WebElement using adaptive and self-healing multi-locators.
|
void |
clearLocalStorage()
Clear local browser storage
|
boolean |
click(java.io.File file)
Clicks a WebElement using adaptive and self-healing multi-locators.
|
boolean |
click(java.lang.String fileName)
Click a WebElement using adaptive and self-healing multi-locators.
|
boolean |
clickElement(java.util.Properties properties) |
void |
delay(int milliseconds)
Delay the thread a number of milliseconds
|
boolean |
enter(java.io.File file,
java.lang.String textToType)
Enters a text (adds a return at the end) into a WebElement using adaptive and self-healing multi-locators.
|
boolean |
enter(java.lang.String fileName,
java.lang.String textToType)
Enters a text (adds a return at the end) into a WebElement using adaptive and self-healing multi-locators.
|
WebElement |
findElement(java.io.File file)
Find a WebElement using adaptive and self-healing multi-locators.
|
WebElement |
findElement(java.util.Properties properties)
Find a WebElement using adaptive and self-healing multi-locators.
|
WebElement |
findElement(java.lang.String fileName)
Find a WebElement using adaptive and self-healing multi-locators.
|
boolean |
getAjaxReady(WebDriver webDriver) |
static java.lang.String[] |
getChecksumTags() |
static java.lang.String[] |
getCkecksumProperties() |
boolean |
getDocumentReady(WebDriver webDriver) |
java.lang.String |
getDomModifiedTime(WebDriver webDriver) |
java.lang.String |
getElementsToExtract()
Get a comma separated list of web elements that should be fetches as candidates
Default: input,textarea,button,select,a,h1,h2,h3,h4,h5,li,span,div,p,th,tr,td,label,svg
|
java.util.List<similo.Locator> |
getLocators()
Get all locators that belong to any of the tags in elementsToExtract
|
java.util.List<similo.Locator> |
getLocators(java.lang.String elementsToExtract)
Get all locators that belong to any of the tags in elementsToExtract
|
long |
getMaxChecksumDiff() |
int |
getMinScore()
Get the minimum score required for a match (100 by default)
|
boolean |
getNewPageValue(WebDriver webDriver) |
java.lang.String |
getPropertiesFolder() |
int |
getStableDelay()
Get the minimum time to wait for a stable GUI state
|
int |
getStepDelay()
Get the max time to wait for the correct GUI state (as last run)
|
int |
getTimeout()
Get the max time to wait for a web element
|
void |
loadCookies(java.lang.String filepath,
WebDriver webDriver)
Load cookies from file
|
void |
manageCookies(java.lang.String fileName,
WebDriver webDriver)
Load or save cookies from file
|
void |
prepareAjaxWait(WebDriver webDriver) |
boolean |
saveCookies(java.lang.String filepath,
WebDriver webDriver)
Save cookies to file
|
static void |
setChecksumTags(java.lang.String[] checksumTags)
Set the tags to create a checksum from
|
static void |
setCkecksumProperties(java.lang.String[] ckecksumProperties)
Set the properties (or attributes) to create the checksum from
|
void |
setElementsToExtract(java.lang.String elementsToExtract)
Set the web elements that should be fetches as candidates
|
void |
setMaxChecksumDiff(long maxChecksumDiff) |
void |
setMinScore(int minScore)
Set the minimum score required for a match
|
void |
setPropertiesFolder(java.lang.String propertiesFolder) |
void |
setStableDelay(int stableDelay)
Set the minimum time to wait for a stable GUI state
|
void |
setStepDelay(int delay)
Set the max time to wait for the correct GUI state (as last run)
|
void |
setTimeout(int timeout)
Set the max time to wait for a web element
|
boolean |
type(java.io.File file,
java.lang.String textToType)
Types a text into a WebElement using adaptive and self-healing multi-locators.
|
boolean |
type(java.lang.String fileName,
java.lang.String textToType)
Types a text into a WebElement using adaptive and self-healing multi-locators.
|
boolean |
typeElement(java.util.Properties properties,
java.lang.String textToType,
boolean addReturn) |
boolean |
waitPageDomAjax(WebDriver webDriver) |
public Similo(WebDriver webDriver)
webDriver
- public Similo(WebDriver webDriver, java.lang.String propertiesFolder)
webDriver
- propertiesFolder
- Path to a folder that contains the property filespublic Similo(WebDriver webDriver, java.lang.String propertiesFolder, java.lang.String javascriptFilename)
webDriver
- propertiesFolder
- Path to a folder that contains the property filespublic WebElement findElement(java.lang.String fileName)
fileName
- Name of the file that contains the locators (excluding the .properties extension).public boolean click(java.lang.String fileName)
fileName
- Name of the file that contains the locators (excluding the .properties extension).public boolean type(java.lang.String fileName, java.lang.String textToType)
fileName
- Name of the file that contains the locators (excluding the .properties extension).textToType
- The text to type in the located web elementpublic boolean enter(java.lang.String fileName, java.lang.String textToType)
fileName
- Name of the file that contains the locators (excluding the .properties extension).textToType
- The text to type in the located web elementpublic WebElement findElement(java.io.File file)
file
- Path to a properties file that contains the locatorspublic boolean click(java.io.File file)
file
- Path to a properties file that contains the locatorspublic boolean type(java.io.File file, java.lang.String textToType)
fileName
- Name of the file that contains the locators (excluding the .properties extension).textToType
- The text to type in the located web elementpublic boolean enter(java.io.File file, java.lang.String textToType)
fileName
- Name of the file that contains the locators (excluding the .properties extension).textToType
- The text to type in the located web elementpublic boolean check(java.lang.String fileName, java.lang.String validExpression)
fileName
- Name of the file that contains the locators (excluding the .properties extension).validExpression
- An expression that determines if the web element is valid (for example: {text}=Name, {width}>100 or {text}*=contains)public boolean check(java.io.File file, java.lang.String validExpression)
file
- Path to a properties file that contains the locatorsvalidExpression
- An expression that determines if the web element is valid (for example: {text}=Name, {width}>100 or {text}*=contains)public boolean check(java.util.Properties properties, java.lang.String validExpression)
properties
- Contains the locators (will be updated if required)validExpression
- An expression that determines if the web element is valid (for example: {text}=Name, {width}>100 or {text}*=contains)public WebElement findElement(java.util.Properties properties)
properties
- Contains the locators (will be updated if required)public boolean clickElement(java.util.Properties properties)
public boolean typeElement(java.util.Properties properties, java.lang.String textToType, boolean addReturn)
public void delay(int milliseconds)
milliseconds
- public java.util.List<similo.Locator> getLocators()
public java.util.List<similo.Locator> getLocators(java.lang.String elementsToExtract)
public int getTimeout()
timeout
- Time in seconds (20 by default)public void setTimeout(int timeout)
timeout
- Time in seconds (20 by default)public int getStepDelay()
timeout
- Time in seconds (10 by default)public void setStepDelay(int delay)
timeout
- Time in seconds (10 by default)public void manageCookies(java.lang.String fileName, WebDriver webDriver)
fileName
- - Name of cookie filewebDriver
- public void loadCookies(java.lang.String filepath, WebDriver webDriver)
filepath
- - Path to cookie filewebDriver
- public boolean saveCookies(java.lang.String filepath, WebDriver webDriver)
filepath
- - Path to cookie filewebDriver
- public void clearLocalStorage()
public java.lang.String getElementsToExtract()
public void setElementsToExtract(java.lang.String elementsToExtract)
elementsToExtract
- A comma separated list of web elementspublic int getMinScore()
public void setMinScore(int minScore)
minScore
- public java.lang.String getPropertiesFolder()
public void setPropertiesFolder(java.lang.String propertiesFolder)
public int getStableDelay()
public void setStableDelay(int stableDelay)
stableDelay
- The time, in seconds, to wait for a stable GUI statepublic long getMaxChecksumDiff()
public void setMaxChecksumDiff(long maxChecksumDiff)
maxChecksumDiff
- The max diff allowed for matching GUI state checksumspublic void prepareAjaxWait(WebDriver webDriver)
public boolean waitPageDomAjax(WebDriver webDriver)
public boolean getNewPageValue(WebDriver webDriver)
public java.lang.String getDomModifiedTime(WebDriver webDriver)
public boolean getDocumentReady(WebDriver webDriver)
public boolean getAjaxReady(WebDriver webDriver)
public static java.lang.String[] getCkecksumProperties()
public static void setCkecksumProperties(java.lang.String[] ckecksumProperties)
ckecksumProperties
- public static java.lang.String[] getChecksumTags()
public static void setChecksumTags(java.lang.String[] checksumTags)
checksumTags
-