Class FastElement
- java.lang.Object
-
- com.qcefast.frameworkSpecific.FastElement
-
public class FastElement extends java.lang.Object
This class is used to mimic the properties/attributes of a UI element in order to use the assignedFramework
to locate that UI element.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description FastElement()
Default constructorFastElement(Framework framework)
Constructor for the Framework of a FastElementFastElement(FastDriver fastDriver)
Constructor for FastElement using aFastDriver
FastElement(FastElementProperties fastElementProperties)
Constructor for fastElementPropertiesFastElement(org.openqa.selenium.WebDriver webDriver)
Constructor for FastElement using a seleniumWebDriver
FastElement(org.openqa.selenium.WebElement seleniumElement)
Constructor for FastElement using a selenium WebElement
-
Method Summary
Modifier and Type Method Description void
addFastElementAncestor(FastElement element)
Adds an element to fastElementAncestors.void
addFastElementAncestor(FastElementProperties fastElementProperties)
Adds an ancestor to fastElementAncestors using the passed in fastElementProperties.void
addFastElementAncestors(FastElement... elements)
Adds an element to fastElementAncestors.void
addFastElementAncestors(FastElementProperties... fastElementProperties)
Adds ancestors to the FastElement invoke this method using the properties of those ancestors.void
checkForNavigator()
Checks to see if the navigator for this element is ready to be usedvoid
clearFastElementPropeties()
Empties the fastElementProperties of this element.void
click()
Clicks on this FastElement using the Framework of this object.void
enterText(java.lang.String text)
Enters the specified text into the fieldvoid
findByClassName()
Locates an element by using the className locator of this FastElement's designated framework, by using the className set for this FastElement.void
findByCSSSelector()
Locates an element by using the cssSelector locator of this FastElement's designated framework, by using the cssSelector set for this FastElement.void
findById()
Locates an element by using the id locator of this FastElement's designated framework, by using the id set for this FastElement.void
findByLinkText()
Locates an element by using the text locator of this FastElement's designated framework, by using the text set for this FastElement.void
findByName()
Locates an element by using the name locator of this FastElement's designated framework, by using the name set for this FastElement.void
findByPartialLinkText()
Locates an element by using the partialLinkText locator of this FastElement's designated framework, by using the partialLinkText set for this FastElement.void
findByTagName()
Locates an element by using the tagName locator of this FastElement's designated framework, by using the tagName set for this FastElement.void
findByText()
Locates an element by using the text locator of this FastElement's designated framework, by using the text set for this FastElement.void
findByXpath()
Locates an element by using the xpath locator of this FastElement's designated framework, by using the xpath set for this FastElement.FastElement
findElementInMe(FastElement childElement)
Find a FastElement that is a descendant of this FastElement.FastElement
findMe()
Locates this FastElement using its designated frameworkjava.lang.String
getAttribute(java.lang.String name)
When the framework is selenium:
Get the value of the given attribute of the element.java.lang.Integer
getBrowserLoops()
Returns browserLoops (number of times FAST Framework will loop through open browser windows while attempting to locate the element) for this FastElement.java.lang.String
getClassName()
Returns the className stored in this FastElement.java.util.List<org.openqa.selenium.WebElement>
getColumnHeaders()
Returns the column headers of aFastHtmlTable
as a list ofWebElement
java.lang.String
getCss()
Returns the css stored in this FastElement.java.lang.String
getElementClassName()
Returns the className of the element using the framework of this FastElementjava.lang.String
getElementCss()
Returns the css of the element using the framework of this FastElementjava.lang.String
getElementId()
Returns the id of the element using the framework of this FastElementjava.lang.String
getElementLinkText()
This method calls and returns the same result as getElementText()java.lang.String
getElementName()
Returns the name of the element using the framework of this FastElementjava.lang.String
getElementTagName()
Returns the tagName of the element using the framework of this FastElementjava.lang.String
getElementText()
Returns the text of the element using the framework of this FastElementjava.lang.String
getElementXpath()
Returns the xpath of the element using the framework of this FastElementFastDriver
getFastDriver()
Returns theFastDriver
that this FastElement is usingjava.util.Set<FastElement>
getFastElementAncestors()
Returns a Set of the FastElementAncestors added for this FastElement in hierarchical order.java.lang.String
getFastElementCss()
A fast created css string built using this object's fastElementPropertiesFastElementProperties
getFastElementProperties()
Returns the fastElementProperties of this FastElementjava.lang.String
getFastElementXpath()
A fast created xpath built using this object's fastElementPropertiesFastHtmlTable
getFastHtmlTable()
Returns aFastHtmlTable
class to represent the html table this FastElement represents.FastElement
getFrameElement()
Returns the Frame that this FastElement is located in.Framework
getFramework()
Returns the Framework this FastElement is currently using.java.lang.String
getId()
Returns the id stored in this FastElement.java.lang.String
getLinkText()
Returns the text stored in this FastElement.org.openqa.selenium.Point
getLocation()
When the framework is selenium:
Where on the page is the top left-hand corner of the rendered element?java.lang.String
getLocatorValLocatorMethodName()
DO NOT CALL THIS METHOD MANUALLY
This method returns the findBy method name of the locator stored in locatorValscom.qcefast.frameworkSpecific.FastElement.FastElementLocatorVals
getLocatorVals()
DO NOT MANUALLY USE THIS METHOD
This method needs to be paired with setFindByLocator or it will not work
This method should only be used when the locator indicator is used in the object field of a testStep.java.lang.String
getLocatorValValue()
DO NOT CALL THIS METHOD MANUALLY
This method returns the value stored in locatorValsjava.lang.String
getName()
Returns the name stored in this FastElement.java.lang.String
getPageTitle()
Returns the title of the page this FastElement resides onjava.lang.String
getPageUrl()
Returns url for the page this FastElement is onjava.lang.String
getPartialLinkText()
Returns the partialLinkText stored in this FastElementjava.lang.Integer
getRetryAttempts()
Returns the retryAttempts (number of times FAST Framework will attempt to find an element within a browser window) for this FastElementorg.openqa.selenium.WebElement
getRowByColumns(java.util.Map<java.lang.String,java.lang.String> columnAndValues)
Returns the table row of aFastHtmlTable
that matches the specified columns and valuesorg.openqa.selenium.WebElement
getRowCell(org.openqa.selenium.WebElement tableRow, java.lang.String columnName)
Returns the cell that matches the specified table row and column name from an html tablejava.util.List<org.openqa.selenium.WebElement>
getRowCells(org.openqa.selenium.WebElement tableRow)
Returns the cells of the specified tableRow as a list ofWebElement
org.openqa.selenium.WebElement
getSeleniumElement()
Gets the selenium webelement of this FastElementorg.openqa.selenium.Dimension
getSize()
When the framework is selenium:
What is the width and height of the rendered element?org.openqa.selenium.WebElement
getTable()
Returns aWebElement
that represents the html table of a fastHtmlTablejava.util.List<org.openqa.selenium.WebElement>
getTableRows()
Returns the table rows of aFastHtmlTable
as a list ofWebElement
java.lang.String
getTagName()
Returns the tagName stored in this FastElement.java.lang.String
getText()
Returns the text stored in this FastElement.java.lang.Double
getWaitTime()
Returns the waitTime (amount of time before timing out while searching for this on a page) of this FastElementjava.lang.String
getXpath()
Returns the xpath stored in this FastElement.boolean
isFindByLocator()
Returns whether or not this element is to be found using a framework locator instead of fastPropertiesboolean
isFound()
Returns whether or not this FastElement has been located by any frameworkboolean
isFoundBySelenium()
Returns whether or not the seleniumElement of this FastElement has been locatedboolean
isUseAncestors()
Returns whether or not this elements fastElementAncestors will be used in locating this objectvoid
javascriptClick()
Clicks on this FastElement using javascript executor.void
removeAllFastElementAncestors()
Removes all elements from this object's fastElementAncestorsvoid
removeFastElementAncestor(FastElement element)
Removes the specified element from the fastElementAncestors of this objectvoid
select(java.lang.String data)
Selects the specified data from a dropdownvoid
setBrowserLoops(java.lang.Integer browserLoops)
Sets browserLoops for this FastElementvoid
setClassName(java.lang.String className)
Replaces the className stored for this FastElement.void
setCss(java.lang.String css)
Replaces the css stored for this FastElement.void
setFastDriver(FastDriver fastDriver)
Sets theFastDriver
that this FastElement is going to usevoid
setFastElementAncestors(java.util.Set<FastElement> fastElementAncestors)
Replaces the fastElementAncestors of this fastElement.void
setFastElementProperties(FastElementProperties fastElementProperties)
Replaces the fastElementProperties of this FastElementvoid
setFindByLocator(boolean findByLocator)
DO NOT MANUALLY USE THIS METHOD
This method needs to be paired with setLocatorVals or it will not work
Set to true if this fastElement is to be found using a framework locator.void
setFrameElement(java.lang.String frame)
Sets the frame that this FastElement is located in.void
setFramework(Framework framework)
Replaces the framework of this FastElement.void
setId(java.lang.String id)
Replaces the id stored for this FastElement.void
setLinkText(java.lang.String linkText)
Replaces the linkText stored for this FastElement.void
setLocatorVals(java.lang.String locator, java.lang.String value)
DO NOT MANUALLY USE THIS METHOD
This method needs to be paired with setFindByLocator or it will not work
This method should only be used when the locator indicator is used in the object field of a testStep.void
setName(java.lang.String name)
Replaces the name stored for this FastElement.void
setPageTitle(java.lang.String pageTitle)
Sets the title of the page this FastElement is onvoid
setPageUrl(java.lang.String pageUrl)
Sets the url of the page this FastElement is onvoid
setPartialLinkText(java.lang.String partialLinkText)
Replaces the partialLinkText stored for this FastElement.void
setRetryAttempts(java.lang.Integer retryAttempts)
Sets retryAttempts for this FastElementvoid
setSeleniumElement(org.openqa.selenium.WebElement seleniumElement)
Replaces the selenium webelement of this FastElementvoid
setTagName(java.lang.String tagName)
Replaces the tagName stored for this FastElement.void
setText(java.lang.String text)
Replaces the text stored for this FastElement.void
setUseAncestors(boolean useAncestors)
Set to true if the fastElementAncestors of this object are to be used to find it.void
setWaitTime(java.lang.Double waitTime)
Sets waitTime for this FastElementvoid
setXpath(java.lang.String xpath)
Replaces the xpath stored for this FastElement.void
submit()
When the framework is selenium: submits the form if the current element is a form.void
takeScreenshot(java.lang.String sshotPth, FastRunProperties fastRunProperties)
Takes a screenshot and saves the image to the specified pathvoid
verifyWebelementText(java.lang.String text)
Enters the specified text into the field
-
-
-
Constructor Detail
-
FastElement
public FastElement()
Default constructor- Since:
- 1.0.0
-
FastElement
public FastElement(org.openqa.selenium.WebDriver webDriver)
Constructor for FastElement using a seleniumWebDriver
- Parameters:
webDriver
- A selenium WebDriver- Since:
- 1.0.0
-
FastElement
public FastElement(FastDriver fastDriver)
Constructor for FastElement using aFastDriver
- Parameters:
fastDriver
- The FastDriver that will be used for this element- Since:
- 1.0.0
-
FastElement
public FastElement(org.openqa.selenium.WebElement seleniumElement) throws FastException
Constructor for FastElement using a selenium WebElement- Parameters:
seleniumElement
- A selenium WebElement- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
FastElement
public FastElement(Framework framework)
Constructor for the Framework of a FastElement- Parameters:
framework
- The framework this fastElement will be using- Since:
- 1.0.0
-
FastElement
public FastElement(FastElementProperties fastElementProperties)
Constructor for fastElementProperties- Parameters:
fastElementProperties
- The fastElementProperties of a fastElement- Since:
- 1.0.0
-
-
Method Detail
-
getSeleniumElement
public org.openqa.selenium.WebElement getSeleniumElement()
Gets the selenium webelement of this FastElement- Returns:
- This object's selenium webelement
- Since:
- 1.0.0
-
setSeleniumElement
public void setSeleniumElement(org.openqa.selenium.WebElement seleniumElement)
Replaces the selenium webelement of this FastElement- Parameters:
seleniumElement
- A selenium webelement- Since:
- 1.0.0
-
getFramework
public Framework getFramework()
Returns the Framework this FastElement is currently using. If the framework was never set,Framework.SELENIUM
will be returned as the default value- Returns:
- The current framework this object is using
- Since:
- 1.0.0
-
setFramework
public void setFramework(Framework framework)
Replaces the framework of this FastElement. FastElement executes some methods differently depending on the current framework- Parameters:
framework
- Framework- Since:
- 1.0.0
-
getFastElementProperties
public final FastElementProperties getFastElementProperties()
Returns the fastElementProperties of this FastElement- Returns:
- The properties FAST will use to find/describe this FastElement
- Since:
- 1.0.0
-
setFastElementProperties
public void setFastElementProperties(FastElementProperties fastElementProperties)
Replaces the fastElementProperties of this FastElement- Parameters:
fastElementProperties
- The properties FAST will use to find/describe this FastElement- Since:
- 1.0.0
-
clearFastElementPropeties
public void clearFastElementPropeties()
Empties the fastElementProperties of this element.- Since:
- 1.0.0
-
getPageTitle
public java.lang.String getPageTitle()
Returns the title of the page this FastElement resides on- Returns:
- The title of the page this object is on
- Since:
- 1.0.0
-
setPageTitle
public void setPageTitle(java.lang.String pageTitle)
Sets the title of the page this FastElement is on- Parameters:
pageTitle
- - The title for the page this object is on- Since:
- 1.0.0
-
getPageUrl
public java.lang.String getPageUrl()
Returns url for the page this FastElement is on- Returns:
- The url of the page this object is on
- Since:
- 1.0.0
-
setPageUrl
public void setPageUrl(java.lang.String pageUrl)
Sets the url of the page this FastElement is on- Parameters:
pageUrl
- - The url of the page this object is on
-
getTagName
public java.lang.String getTagName()
Returns the tagName stored in this FastElement.- Returns:
- The tagName stored for FastElement. Not to be confused with the value returned from getElementTagName(), though the value can be the same
- Since:
- 1.0.0
-
getElementTagName
public java.lang.String getElementTagName() throws FastException
Returns the tagName of the element using the framework of this FastElement- Returns:
- The tagName of this element
- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
setTagName
public void setTagName(java.lang.String tagName)
Replaces the tagName stored for this FastElement. Will be used to aid in finding this element. Also sets the tagName property in fastElementProperties- Parameters:
tagName
- The tagName to be stored for this FastElement- Since:
- 1.0.0
-
getClassName
public java.lang.String getClassName()
Returns the className stored in this FastElement.- Returns:
- The className stored for FastElement. Not to be confused with the value returned from getElementClassName(), though the value will likely be the same
- Since:
- 1.0.0
-
getElementClassName
public java.lang.String getElementClassName() throws FastException
Returns the className of the element using the framework of this FastElement- Returns:
- The className of this element
- Throws:
FastException
- If error occurs during execution- Since:
- 1.0.0
-
setClassName
public void setClassName(java.lang.String className)
Replaces the className stored for this FastElement. Will be used to aid in finding this element. Also sets the className property in fastElementProperties- Parameters:
className
- The className to be stored for this FastElement- Since:
- 1.0.0
-
getId
public java.lang.String getId()
Returns the id stored in this FastElement.- Returns:
- The id stored for FastElement. Not to be confused with the value returned from getElementId(), though the value can be the same
-
getElementId
public java.lang.String getElementId() throws FastException
Returns the id of the element using the framework of this FastElement- Returns:
- The id of this element
- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
setId
public void setId(java.lang.String id)
Replaces the id stored for this FastElement. Will be used to aid in finding this element. Also sets the id property in fastElementProperties- Parameters:
id
- The id to be stored for id FastElement- Since:
- 1.0.0
-
getText
public java.lang.String getText()
Returns the text stored in this FastElement.- Returns:
- The text stored for FastElement. Not to be confused with the value returned from getElementText(), though the value can be same
- Since:
- 1.0.0
-
getElementText
public java.lang.String getElementText() throws FastException
Returns the text of the element using the framework of this FastElement- Returns:
- The text of this element
- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
setText
public void setText(java.lang.String text)
Replaces the text stored for this FastElement. Will be used to aid in finding this element. Also sets the id property in fastElementProperties- Parameters:
text
- The text to be stored for this FastElement- Since:
- 1.0.0
-
getLinkText
public java.lang.String getLinkText()
Returns the text stored in this FastElement.- Returns:
- The text stored for FastElement. Not to be confused with the value returned from getElementLinkText(), though the value will likely be the same
- Since:
- 1.0.0
-
getElementLinkText
public java.lang.String getElementLinkText() throws FastException
This method calls and returns the same result as getElementText()- Returns:
- The text of this element
- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
setLinkText
public void setLinkText(java.lang.String linkText)
Replaces the linkText stored for this FastElement. Will be used to aid in finding this element. Also sets the linkText property in fastElementProperties- Parameters:
linkText
- The linkText to be stored for this FastElement- Since:
- 1.0.0
-
getName
public java.lang.String getName()
Returns the name stored in this FastElement.- Returns:
- The name stored for FastElement. Not to be confused with the value returned from getElementName(), though the value can be the same
- Since:
- 1.0.0
-
getElementName
public java.lang.String getElementName() throws FastException
Returns the name of the element using the framework of this FastElement- Returns:
- The name of this element
- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
setName
public void setName(java.lang.String name)
Replaces the name stored for this FastElement. Will be used to aid in finding this element. Also sets the name property in fastElementProperties- Parameters:
name
- The name to be stored for this FastElement- Since:
- 1.0.0
-
getPartialLinkText
public java.lang.String getPartialLinkText()
Returns the partialLinkText stored in this FastElement- Returns:
- The name stored for FastElement. Not to be confused with the value returned from getElementName(), though the value can be the same
- Since:
- 1.0.0
-
setPartialLinkText
public void setPartialLinkText(java.lang.String partialLinkText)
Replaces the partialLinkText stored for this FastElement. Will be used to aid in finding this element. Also sets the partialLinkText property in fastElementProperties- Parameters:
partialLinkText
- The partialLinkText to be stored for this FastElement- Since:
- 1.0.0
-
getXpath
public java.lang.String getXpath()
Returns the xpath stored in this FastElement.- Returns:
- The xpath stored for FastElement. Not to be confused with the value returned from getElementXPath(), which may be a different value
- Since:
- 1.0.0
-
getElementXpath
public java.lang.String getElementXpath() throws FastException
Returns the xpath of the element using the framework of this FastElementWhen the framework is selenium:
Selenium WebElement does not have a method to return the xpath of a found element. To compensate, we return a manually built xpath using the hierarchy of the element.- Returns:
- The xpath of this element
- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
setXpath
public void setXpath(java.lang.String xpath)
Replaces the xpath stored for this FastElement. Will be used to aid in finding this element. Also sets the xpath property in fastElementProperties- Parameters:
xpath
- The xpath to be stored for this FastElement- Since:
- 1.0.0
-
getCss
public java.lang.String getCss()
Returns the css stored in this FastElement.- Returns:
- The css stored for FastElement. Not to be confused with the value returned from getElementCss(), which may be a different value
- Since:
- 1.0.0
-
getElementCss
public java.lang.String getElementCss() throws FastException
Returns the css of the element using the framework of this FastElementWhen the framework is selenium:
Selenium WebElement does not have a method to return the cssSelectors of a found element. To compensate, we return a manually built cssSelector string for the element using javascript.- Returns:
- The css of this element
- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
setCss
public void setCss(java.lang.String css)
Replaces the css stored for this FastElement. Will be used to aid in finding this element. Also sets the css property in fastElementProperties- Parameters:
css
- The css to be stored for this FastElement- Since:
- 1.0.0
-
getFastElementCss
public java.lang.String getFastElementCss()
A fast created css string built using this object's fastElementProperties- Returns:
- A fastElement css string
- Since:
- 1.0.0
-
getFastElementXpath
public java.lang.String getFastElementXpath()
A fast created xpath built using this object's fastElementProperties- Returns:
- A fastElement xpath string
- Since:
- 1.0.0
-
getFastHtmlTable
public FastHtmlTable getFastHtmlTable() throws FastException
Returns aFastHtmlTable
class to represent the html table this FastElement represents.- Returns:
- The
FastHtmlTable
this FastElement represents. Constructs and returns a fastHtmlTable object using this FastElement if on hasn't already been made - Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
getTable
public org.openqa.selenium.WebElement getTable() throws FastException
Returns aWebElement
that represents the html table of a fastHtmlTable- Returns:
- The html table
- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
getColumnHeaders
public java.util.List<org.openqa.selenium.WebElement> getColumnHeaders() throws FastException
Returns the column headers of aFastHtmlTable
as a list ofWebElement
- Returns:
- Column headers of the html table this FastElement represents
- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
getTableRows
public java.util.List<org.openqa.selenium.WebElement> getTableRows() throws FastException
Returns the table rows of aFastHtmlTable
as a list ofWebElement
- Returns:
- Table rows of the html table this FastElement represents
- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
getRowByColumns
public org.openqa.selenium.WebElement getRowByColumns(java.util.Map<java.lang.String,java.lang.String> columnAndValues) throws FastException
Returns the table row of aFastHtmlTable
that matches the specified columns and values- Parameters:
columnAndValues
- A map containing the column and value pairs of a row in a html table- Returns:
- Row containing column and values specified in columnAndValues
- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
getRowCells
public java.util.List<org.openqa.selenium.WebElement> getRowCells(org.openqa.selenium.WebElement tableRow) throws FastException
Returns the cells of the specified tableRow as a list ofWebElement
- Parameters:
tableRow
- The html table row whose cells are being obtained- Returns:
- A list of
WebElement
which designate the cells of a row in an html table - Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
getRowCell
public org.openqa.selenium.WebElement getRowCell(org.openqa.selenium.WebElement tableRow, java.lang.String columnName) throws FastException
Returns the cell that matches the specified table row and column name from an html table- Parameters:
tableRow
- An html table rowcolumnName
- A column name of an html table- Returns:
- The cell that is in the specified columnName of the specified tableRow
- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
getFastDriver
public FastDriver getFastDriver()
Returns theFastDriver
that this FastElement is using- Returns:
- The FastDriver this FastElement is using
- Since:
- 1.0.0
-
setFastDriver
public void setFastDriver(FastDriver fastDriver)
Sets theFastDriver
that this FastElement is going to use- Parameters:
fastDriver
- FastDriver that will be utilized by this FastElement- Since:
- 1.0.0
-
click
public void click() throws FastException
Clicks on this FastElement using the Framework of this object.Framework.SELENIUM
will be used by default if a framework was not explicitly set- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
javascriptClick
public void javascriptClick() throws FastException
Clicks on this FastElement using javascript executor.Framework.SELENIUM
will be used by default if a framework was not explicitly setWhen the framework is not selenium:
Functionality with be the same as theclick()
method- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
submit
public void submit() throws FastException
When the framework is selenium: submits the form if the current element is a form.- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
enterText
public void enterText(java.lang.String text) throws FastException
Enters the specified text into the field- Parameters:
text
- The value to be set entered into this FastElement- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
verifyWebelementText
public void verifyWebelementText(java.lang.String text) throws FastException
Enters the specified text into the field- Parameters:
text
- The value to be set entered into this FastElement- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
select
public void select(java.lang.String data) throws FastException
Selects the specified data from a dropdown- Parameters:
data
- The data to be selected from this FastElement- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
getAttribute
public java.lang.String getAttribute(java.lang.String name) throws FastException
When the framework is selenium:
Get the value of the given attribute of the element. Will return the current value, even if this has been modified after the page has been loaded.More exactly, this method will return the value of the property with the given name, if it exists. If it does not, then the value of the attribute with the given name is returned. If neither exists, null is returned.
The "style" attribute is converted as best can be to a text representation with a trailing semi-colon.
The following are deemed to be "boolean" attributes, and will return either "true" or null:
async, autofocus, autoplay, checked, compact, complete, controls, declare, defaultchecked, defaultselected, defer, disabled, draggable, ended, formnovalidate, hidden, indeterminate, iscontenteditable, ismap, itemscope, loop, multiple, muted, nohref, noresize, noshade, novalidate, nowrap, open, paused, pubdate, readonly, required, reversed, scoped, seamless, seeking, selected, truespeed, willvalidate
Finally, the following commonly mis-capitalized attribute/property names are evaluated as expected:
- If the given name is "class", the "className" property is returned.
- If the given name is "readonly", the "readOnly" property is returned.
See W3C WebDriver specification for more details.
When the framework is leanft:
Returns the value of a single attribute. Parameters: attributeName - the attribute name for the value to retrieve. Returns: the value of the specified attribute (null if the attribute does not exist).- Parameters:
name
- The name of the attribute.- Returns:
- The attribute
- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
getLocation
public org.openqa.selenium.Point getLocation() throws FastException
When the framework is selenium:
Where on the page is the top left-hand corner of the rendered element?See W3C WebDriver specification for more details.
When the framework is leanft:
Returns this object's coordinates relative to the parent window (in pixels).- Returns:
- The object's location
- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
getSize
public org.openqa.selenium.Dimension getSize() throws FastException
When the framework is selenium:
What is the width and height of the rendered element?See W3C WebDriver specification for more details.
When the framework is leanft:
Returns this object's size (in pixels). Returns: this object's size (in pixels). Throws: GeneralLeanFtException - if error occurs during execution- Returns:
- The size of the object
- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
isFound
public boolean isFound()
Returns whether or not this FastElement has been located by any framework- Returns:
- True if this FastElement has been found. False if it has not.
- Since:
- 1.0.0
-
isFoundBySelenium
public boolean isFoundBySelenium()
Returns whether or not the seleniumElement of this FastElement has been located- Returns:
- True if the seleniumElement is not null. False if it is.
- Since:
- 1.0.0
-
isFindByLocator
public boolean isFindByLocator()
Returns whether or not this element is to be found using a framework locator instead of fastProperties- Returns:
- True if this element will be found using a framework locator. False if not
- Since:
- 1.0.0
-
setFindByLocator
public void setFindByLocator(boolean findByLocator)
DO NOT MANUALLY USE THIS METHOD
This method needs to be paired with setLocatorVals or it will not work
Set to true if this fastElement is to be found using a framework locator.
DO NOT MANUALLY USE THIS METHOD- Parameters:
findByLocator
- true or false- Since:
- 1.0.0
-
isUseAncestors
public boolean isUseAncestors()
Returns whether or not this elements fastElementAncestors will be used in locating this object- Returns:
- True if the ancestors will be used to locate this object. False if they will not
- Since:
- 1.0.0
-
setUseAncestors
public void setUseAncestors(boolean useAncestors)
Set to true if the fastElementAncestors of this object are to be used to find it. Set to false if the fastElementAncestors are not to be used- Parameters:
useAncestors
- true or false- Since:
- 1.0.0
-
getFastElementAncestors
public java.util.Set<FastElement> getFastElementAncestors()
Returns a Set of the FastElementAncestors added for this FastElement in hierarchical order. The first element being the highest hierarchical element on the path to this FastElement. The last element in this set being the closest parent of this FastElement.- Returns:
- The ancestors added to this fast element
- Since:
- 1.0.0
-
setFastElementAncestors
public void setFastElementAncestors(java.util.Set<FastElement> fastElementAncestors)
Replaces the fastElementAncestors of this fastElement. The first element should be the highest hierarchical element on the path to this FastElement. The last element should be the closest parent of this FastElement- Parameters:
fastElementAncestors
- Ancestor elements to this FastElement- Since:
- 1.0.0
-
addFastElementAncestor
public void addFastElementAncestor(FastElement element)
Adds an element to fastElementAncestors. The element that is added with this method should be a descendant of all previous elements added to fastElementAncestors- Parameters:
element
- A fastElementAncestor for this object- Since:
- 1.0.0
-
addFastElementAncestors
public void addFastElementAncestors(FastElement... elements)
Adds an element to fastElementAncestors. The element that is added with this method should be a descendant of all previous elements added to fastElementAncestors- Parameters:
elements
- FastElementAncestors for this object- Since:
- 1.0.0
-
addFastElementAncestor
public void addFastElementAncestor(FastElementProperties fastElementProperties)
Adds an ancestor to fastElementAncestors using the passed in fastElementProperties. The properties passed into this method should be a descendant of all previous elements added to fastElementAncestors- Parameters:
fastElementProperties
- The properties of a fastElement- Since:
- 1.0.0
-
addFastElementAncestors
public void addFastElementAncestors(FastElementProperties... fastElementProperties) throws FastException
Adds ancestors to the FastElement invoke this method using the properties of those ancestors. The array should begin with the highest level ancestor, and end with the most recent ancestor- Parameters:
fastElementProperties
- An array of properties that represent the ancestors of the FastElement invoking this method. The array should be ordered from highest level ancestor first, to most recent ancestor last.- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
removeFastElementAncestor
public void removeFastElementAncestor(FastElement element)
Removes the specified element from the fastElementAncestors of this object- Parameters:
element
- The element to be removed from the fastElementAncestors of this object- Since:
- 1.0.0
-
removeAllFastElementAncestors
public void removeAllFastElementAncestors()
Removes all elements from this object's fastElementAncestors- Since:
- 1.0.0
-
getLocatorVals
public com.qcefast.frameworkSpecific.FastElement.FastElementLocatorVals getLocatorVals()
DO NOT MANUALLY USE THIS METHOD
This method needs to be paired with setFindByLocator or it will not work
This method should only be used when the locator indicator is used in the object field of a testStep. Returns the locatorVals field containing the locator to be used finding this element- Returns:
- Class used
- Since:
- 1.0.0
-
setLocatorVals
public void setLocatorVals(java.lang.String locator, java.lang.String value) throws FastException
DO NOT MANUALLY USE THIS METHOD
This method needs to be paired with setFindByLocator or it will not work
This method should only be used when the locator indicator is used in the object field of a testStep. If findByLocator is set to true, the locator and value passed into this method will be what is used to find the element- Parameters:
locator
- The framework locator. ie. XPath, Name, Text, etcvalue
- The value the locator will use the find the element- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
getFrameElement
public FastElement getFrameElement()
Returns the Frame that this FastElement is located in. Selenium needs to switch into frames before being able to interact with any elements elements that exists within them- Returns:
- A frame that this FastElement is in
- Since:
- 1.0.0
-
setFrameElement
public void setFrameElement(java.lang.String frame) throws FastException
Sets the frame that this FastElement is located in. Selenium needs to switch into a frame in order to interact with elements that exist within the frame- Parameters:
frame
- Attributes needed to find a frame on a webpage- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
checkForNavigator
public void checkForNavigator() throws FastException
Checks to see if the navigator for this element is ready to be used- Throws:
FastException
- If the navigator has not been used yet- Since:
- 1.0.0
-
findByCSSSelector
public void findByCSSSelector() throws FastException
Locates an element by using the cssSelector locator of this FastElement's designated framework, by using the cssSelector set for this FastElement. If found, sets the framework specific element- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
findByClassName
public void findByClassName() throws FastException
Locates an element by using the className locator of this FastElement's designated framework, by using the className set for this FastElement. If found, sets the framework specific element- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
findById
public void findById() throws FastException
Locates an element by using the id locator of this FastElement's designated framework, by using the id set for this FastElement. If found, sets the framework specific element- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
findByText
public void findByText() throws FastException
Locates an element by using the text locator of this FastElement's designated framework, by using the text set for this FastElement. If found, sets the framework specific element- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
findByName
public void findByName() throws FastException
Locates an element by using the name locator of this FastElement's designated framework, by using the name set for this FastElement. If found, sets the framework specific element- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
findByPartialLinkText
public void findByPartialLinkText() throws FastException
Locates an element by using the partialLinkText locator of this FastElement's designated framework, by using the partialLinkText set for this FastElement. If found, sets the framework specific element.When the framework is leanft:
LeanFt does not have a partialLinkText locator, so we are using its xpath locator instead. The xpath is as follows //*[contains(text(), 'partialLinkText')]- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
findByLinkText
public void findByLinkText() throws FastException
Locates an element by using the text locator of this FastElement's designated framework, by using the text set for this FastElement. If found, sets the framework specific element- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
findByTagName
public void findByTagName() throws FastException
Locates an element by using the tagName locator of this FastElement's designated framework, by using the tagName set for this FastElement. If found, sets the framework specific element- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
findByXpath
public void findByXpath() throws FastException
Locates an element by using the xpath locator of this FastElement's designated framework, by using the xpath set for this FastElement. If found, sets the framework specific element- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
takeScreenshot
public void takeScreenshot(java.lang.String sshotPth, FastRunProperties fastRunProperties) throws FastException
Takes a screenshot and saves the image to the specified path- Parameters:
sshotPth
- The location and file name the screenshot is saved to.fastRunProperties
- The properties that Fast is running with- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
getWaitTime
public java.lang.Double getWaitTime()
Returns the waitTime (amount of time before timing out while searching for this on a page) of this FastElement- Returns:
- time in seconds. Defaults to 3.0 if no waitTime has been set
- Since:
- 1.0.0
-
setWaitTime
public void setWaitTime(java.lang.Double waitTime)
Sets waitTime for this FastElement- Parameters:
waitTime
- Time in seconds- Since:
- 1.0.0
-
getBrowserLoops
public java.lang.Integer getBrowserLoops()
Returns browserLoops (number of times FAST Framework will loop through open browser windows while attempting to locate the element) for this FastElement.- Returns:
- number of browser loops. Defaults to 3 if browserLoops has not been set
- Since:
- 1.0.0
-
setBrowserLoops
public void setBrowserLoops(java.lang.Integer browserLoops)
Sets browserLoops for this FastElement- Parameters:
browserLoops
- Number of times to loops through open browser windows to search for element- Since:
- 1.0.0
-
getRetryAttempts
public java.lang.Integer getRetryAttempts()
Returns the retryAttempts (number of times FAST Framework will attempt to find an element within a browser window) for this FastElement- Returns:
- number of retryAttempts. Defaults to 3 if retryAttempts has not been set
- Since:
- 1.0.0
-
setRetryAttempts
public void setRetryAttempts(java.lang.Integer retryAttempts)
Sets retryAttempts for this FastElement- Parameters:
retryAttempts
- Number of times to attempt to find the element in an open browser window- Since:
- 1.0.0
-
findMe
public FastElement findMe() throws FastException
Locates this FastElement using its designated framework- Returns:
- Returns the FastElement invoking this method with its framework specific element set
- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
getLocatorValLocatorMethodName
public java.lang.String getLocatorValLocatorMethodName() throws FastException
DO NOT CALL THIS METHOD MANUALLY
This method returns the findBy method name of the locator stored in locatorVals- Returns:
- The findBy method name of the locator stored in locatorVals
- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
getLocatorValValue
public java.lang.String getLocatorValValue() throws FastException
DO NOT CALL THIS METHOD MANUALLY
This method returns the value stored in locatorVals- Returns:
- The value stored in locatorVals
- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
findElementInMe
public FastElement findElementInMe(FastElement childElement) throws FastException
Find a FastElement that is a descendant of this FastElement. If the element invoking this method has yet to be found, it will be found using its designated framework before searching for the childElement.- Parameters:
childElement
- A FastElement that is a descendant of the element invoking this method- Returns:
- Returns the childElement with its framework specific element set.
- Throws:
FastException
- If an error occurs during execution- Since:
- 1.0.0
-
-