Package org.mozilla.zest.core.v1
Class ZestClientScreenshot
- java.lang.Object
-
- org.mozilla.zest.core.v1.ZestElement
-
- org.mozilla.zest.core.v1.ZestStatement
-
- org.mozilla.zest.core.v1.ZestClient
-
- org.mozilla.zest.core.v1.ZestClientScreenshot
-
public class ZestClientScreenshot extends ZestClient
AZestClientaction that takes a screenshot.The screenshot can be saved to a file and/or to a variable (for the latter Base64 encoded).
- Since:
- 0.14.0
-
-
Field Summary
-
Fields inherited from class org.mozilla.zest.core.v1.ZestElement
JSON_ELEMENT_TYPE
-
-
Constructor Summary
Constructors Constructor Description ZestClientScreenshot()Constructs aZestClientScreenshotwith no file path nor variable name.ZestClientScreenshot(String windowHandle, String filePath, String variableName)Constructs aZestClientScreenshotwith the given file path and variable name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ZestClientScreenshotdeepCopy()Deep copy.StringgetFilePath()Gets the path to the file.StringgetVariableName()Gets the name of the variable.StringgetWindowHandle()Gets the window handle.Stringinvoke(ZestRuntime runtime)booleanisPassive()Checks if is passive.voidsetFilePath(String filePath)Sets the path to the file.voidsetVariableName(String variableName)Sets the name of the variable.voidsetWindowHandle(String windowHandle)Sets the window handle.-
Methods inherited from class org.mozilla.zest.core.v1.ZestClient
isSameSubclass
-
Methods inherited from class org.mozilla.zest.core.v1.ZestStatement
getIndex, getNext, getPrevious, init, insertAfter, insertBefore, isEnabled, remove, setEnabled, setNext, setPrev
-
Methods inherited from class org.mozilla.zest.core.v1.ZestElement
getElementType, setElementType
-
-
-
-
Constructor Detail
-
ZestClientScreenshot
public ZestClientScreenshot()
Constructs aZestClientScreenshotwith no file path nor variable name.
-
ZestClientScreenshot
public ZestClientScreenshot(String windowHandle, String filePath, String variableName)
Constructs aZestClientScreenshotwith the given file path and variable name.- Parameters:
windowHandle- the window handle to obtain the client.filePath- the path to the file where to save the screenshot, might benull.variableName- the name of the variable where to save the screenshot (Base64 encoded), might benull.
-
-
Method Detail
-
getWindowHandle
public String getWindowHandle()
Gets the window handle.- Returns:
- the window handle, might be
null.
-
setWindowHandle
public void setWindowHandle(String windowHandle)
Sets the window handle.- Parameters:
windowHandle- the new window handle.
-
getFilePath
public String getFilePath()
Gets the path to the file.- Returns:
- the path to the file, might be
null.
-
setFilePath
public void setFilePath(String filePath)
Sets the path to the file.Variables are replaced before using the path.
- Parameters:
filePath- the path to the file.
-
getVariableName
public String getVariableName()
Gets the name of the variable.- Returns:
- the name of the variable, might be
null.
-
setVariableName
public void setVariableName(String variableName)
Sets the name of the variable.- Parameters:
variableName- the name of the variable.
-
invoke
public String invoke(ZestRuntime runtime) throws ZestClientFailException
- Specified by:
invokein classZestClient- Throws:
ZestClientFailException
-
deepCopy
public ZestClientScreenshot deepCopy()
Description copied from class:ZestElementDeep copy.- Specified by:
deepCopyin classZestStatement- Returns:
- the zest element
-
isPassive
public boolean isPassive()
Description copied from class:ZestStatementChecks if is passive.- Specified by:
isPassivein classZestStatement- Returns:
- true, if is passive
-
-