Set configuration parameter to given value. Return previous value.
—
Parameter: LogScreenshot
Enables or disables logging screenshots when keyword fails.
Default is screenshot (True). False disables screenshots from logs when keyword fails.
Examples
SetConfig LogScreenshot False
SetConfig LogScreenshot True
—
Parameter: ScreenshotType
Defines how screenshot is taken. Default is normal screenshot.
“html” saves page as html frame in test log. “all” saves both image and html page.
Examples
SetConfig ScreenshotType html
SetConfig ScreenshotType screenshot
SetConfig ScreenshotType all
—
Parameter: OSScreenshots
Defines if screenhots are taken using selenium’s or operating system’s functionalities.
Default is selenium screenshot (False).
Examples
SetConfig OSScreenshots True
SetConfig OSScreenshots False
—
Parameter: CssSelectors
Use CSS selectors for finding elements.
CSS selectors is optional way to find elements that
are difficult to catch by default selectors. Typically
those elements are inputs, checkboxes and dropdowns
without placeholder texts.
With CSS selectors the detection is tried with:
Examples
SetConfig CssSelectors on
TypeText MyLocator Robot
SetConfig CssSelectors off
—
Parameter: SearchDirection
Set search direction for element search.
Search direction is “up”, “down”, “left”, “right” and “closest”
Examples
SetConfig SearchDirection right
TypeText MyLocator Robot
SetConfig SearchDirection closest
Set key to be pressed after text is written to input field.
By default tab key (ue004) is pressed
Values, that are mapped for selenium keys are:
Examples
SetConfig LineBreak \ue004 # Tab key
SetConfig LineBreak \ue007 # Enter key
SetConfig LineBreak ${EMPTY} # Do not send anything
Set key to be pressed before text is written to input field.
By default uses webdrivers clear method to clear element.
Examples
SetConfig ClearKey None # Uses clear method (=default)
SetConfig ClearKey {NULL} # Does nothing
SetConfig ClearKey {CONTROL + A} # Select all and overwrite
# One time use:
TypeText username Robot clear_key={CONTROL + A}
Parameter: CheckInputValue
Check that real value matches to preferred value after TypeText.
If value is not match we try to re type (three times before fail)
This is optional feature. Default = false.
Use with caution on elements where webdriver has tendency to lost focus
and some part of the preferred text gone missing.
Examples
SetConfig CheckInputValue True
SetConfig CheckInputValue False
# One time use:
TypeText username Robot check=True
—
Parameter: DefaultTimeout
Set default timeout for QWeb keywords.
Timeout can be overridden by entering it manually
Examples
SetConfig DefaultTimeout 10s
# One time use:
VerifyText Foo 60s
Set default timeout for XHR (How log we wait page to be loaded).
Timeout can be overridden by entering it manually
—
Parameter: DefaultDocument
Switches to default frame automatically.
If some other frame is used by previous keyword
we switch back to default after keyword is executed so
that we are starting to find next locator from html document
instead of previously used frame.
Default = True
Use False only when there is need to use and move
between frames and page manually for some reason.
Examples
SetConfig DefaultDocument True
SetConfig DefaultDocument False
SetConfig DefaultDocument On
SetConfig DefaultDocument off
—
Parameter: CaseInsensitive
Set containing_text_match according to selected case sensitivity.
Default = False
Note: if containing_text_match has been overwritten manually
this will return the default value.
Examples
SetConfig CaseInsensitive True
SetConfig CaseInsensitive False
—
Parameter: VerifyAppAccuracy
Set VerifyApp accuracy. Default is 0.9999. You should not use
value of 1 because browser rendering will cause false positives.
Examples
SetConfig VerifyAppAccuracy 0.99999
Examples
SetConfig WindowSize 1920x1080
—
Parameter: InputHandler
Default handler is “selenium” which uses Selenium library’s
methods clear() and send_keys(). These methods assume that
the web element is writable (enabled). Inserts tab character
at the end of text.
Alternative writer “raw” uses pyautogui to input text directly
without checking the web element state. This version is intended
to be used when the web page doesn’t update input element status
Selenium compliant way.
Examples
SetConfig InputHandler raw
SetConfig InputHandler selenium
Element with no offset is considered invisible by default.
To bypass this check set OffsetCheck to false.
Examples
SetConfig OffsetCheck False #returns also elements that has offset=0
SetConfig OffsetCheck True #offset is needed (default)
# One time use:
ClickItem Qentinel offset=False
If set to false no visibility check is made when searching elements.
Examples
SetConfig Visibility False #returns visible and invisible elements
SetConfig Visibility True #returns only visible elements(default).
# One time use:
ClickItem Qentinel visibility=False
If InViewport is set to true every element outside of current viewport is considered
invisible. This helps to narrow searching area when there is lots of similar texts/elements
in dom content. This can be also used to prevent searching functions to match any element
that is hidden outside of viewport - even if css visibility settings of given element
says that it’s visible.
Examples
SetConfig InViewport False #returns all matching elements(default)
SetConfig InViewport True #element has to be inside of current viewport
ClickItem Qentinel viewport=False
When SearchMode is used, any found web element is highlighted with blue borders
before the actual execution. This setting is useful especially in debug mode when
we want to search right kw:s and locators to actual testscript.
Examples
SetConfig SearchMode debug #Highlights element, but won't put action on it
SetConfig SearchMode draw #Highlights element and then executes kw (default)
SetConfig SearchMode None #Turns off highlighting element
When WindowFind is used VerifyText is not looking texts for dom, but simulates
ctrl+f like search to find if text exists.
Examples
SetConfig WindowFind True #Searching text from current viewport
SetConfig WindowFind False #Searching text from dom(default)
—
Parameter: SearchStrategy Values
Set search strategy for element search.
Strategy type is either “all input elements”, or “matching input element”.
“all input elements” is a plain xpath that is used to find all elements
considered as input elements.
“matching input element” is an xpath with mandatory placeholder “{}” for
search string. Xpath expression is completed by xpath.format(locator)
internally and therefore must include placeholder “{}”. Used to find elements
matching with a custom search string. Placeholder can be positional, such as {0}
and repeated in that case.
Returns previously used search strategy.
Examples
SetConfig ActiveAreaXpath //input//textarea
SetConfig AllInputElements //input//textarea
SetConfig MatchingInputElement //*[@placeholder="{}"]
SetConfig MatchingInputElement containing input element
${previous}= SetConfig AllInputElements //input
SetConfig AllInputElements ${previous}
note: in the above case “containing input element” will use an xpath expression
such that input elements that contain partial matches are used.
Parameters |
xpath ( str) – xpath expression with or without “xpath = “ |
raises ValueError |
Unknown search strategy: |
raises — |
|
raises Parameter |
MultipleAnchors: |
raises Normally QWeb requires anchor to be an unique text. If MultipleAnchors is set to False, |
|
raises QWeb accepts multiple anchors and selects the first one. |
|
Examples
SetConfig MultipleAnchors True # Accept multiple anchors
SetConfig MultipleAnchors False # Raise error if anchor is not unique
Clicks Input element before typing. This is sometimes needed to activate
target element.
Examples
SetConfig ClickToFocus True # Clicks element before TypeText
SetConfig ClickToFocus False # Handle TypeText without clicks(default)
Sets double-click the default action for all Click* keywords.
Examples
SetConfig DoubleClick True # All Click keywords perform double-click action
SetConfig DoubleClick False # Single-click action(default)
Option for handling alerts boxes, on by default.
Examples
SetConfig HandleAlerts False
Return any value (even empty) from input element without waiting.
Default = false (Raises QWebValueError if field is empty after timeout).
Examples
SetConfig BlindReturn True
${VALUE} GetInputValue username
#Some value must exists inside of given timeout(default):
SetConfig BlindReturn False
${VALUE} GetInputValue username
# One time use:
${VALUE} GetInputValue username blind=True
Set delay for Paceword.
This is meant to be used in demo purposes only
and is not recommended way to control execution flow.
Default = 0s (No delays before execution).
Examples
# Wait 0.5 seconds before any Paceword is executed:
SetConfig Delay 0.5s
# One time use - Wait 1s before given Paceword is executed:
TypeText username QRobot delay=1s
Set default interval for QWeb retry keywords.
Timeout can be overridden by entering it manually
Examples
SetConfig RetryInterval 1s
# One time use:
ClickUntil Foo button interval=3
Set a verificaton keyword to be run before any interaction
keywords (click*, get_text, dropdown).
Most common use for this configuration is in applications, that have a custom
“spinner”/ loading indicator which needs to be waited even if
page itself is already in ReadyState.
Any custom robot fw keywords which start with word “Verify” can be used as RunBefore keyword.
A resource file defining this keyword must be imported prior to usage.
Supports giving keyword to run and parameters either in python or in robot framework syntax.
Robot fw syntax needs to be given in a variable due to handling of arguments.
Examples
# Python syntax
SetConfig RunBefore element.verify_no_element('//html[contains(@class, "custom-busy")]')
ClickText Foo
# Waits that custom spinner disappears before running other keywords
# Robot Framework syntax, needs to be in variable
${run_bf}= SetVariable VerifyNoText Loading.... timeout=5
SetConfig RunBefore ${run_bf}
ClickText Foo
# Waits that text "Loading..." disappears before running other keywords