You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Little import cleanups.
Expose some often used robot.utils via our utils.
Fixes and cleanup to running keyword on failure.
1. Return value from `Register keyword to run on failure` can now
always be used as an argument to the keyword. In practice the
keyword nowadays returns `None` if the functionality was disabled
and `None` (as well as `'NONE'`) can be used to disable the
functionality. Fixesrobotframework#176.
2. Moved the hook method to run when a keyword fails to the core.
This simplifies implementation. The hook method was also
renamed from `run_on_failure` to `failure_occurred`.
Make public API public. robotframework#882
Renamed these:
_run_on_failure_keyword
_speed_in_secs
_timeout_in_secs
_implicit_wait_in_secs
to these:
run_on_failure_keyword
speed
timeout
implicit_wait
Original attributes still work but are deprecated. Deprecation isn't
currently tested but unit tests could be added.
_browser -> browser robotframework#882
"""Sets the keyword to execute when a SeleniumLibrary keyword fails.
27
26
28
-
`keyword_name` is the name of a keyword (from any available
29
-
libraries) that will be executed if a SeleniumLibrary keyword fails.
30
-
It is not possible to use a keyword that requires arguments.
31
-
Using the value "Nothing" will disable this feature altogether.
27
+
`keyword` is the name of a keyword that will be executed if a
28
+
SeleniumLibrary keyword fails. It is possible to use any available
29
+
keyword, including user keywords or keywords from other libraries,
30
+
but the keyword must not take any arguments.
32
31
33
32
The initial keyword to use is set in `importing`, and the
34
33
keyword that is used by default is `Capture Page Screenshot`.
35
34
Taking a screenshot when something failed is a very useful
36
35
feature, but notice that it can slow down the execution.
37
36
37
+
It is possible to use string "Nothing" or "None", case-insensitively,
38
+
as well as any value considered false in Python to disable this
39
+
feature altogether.
40
+
38
41
This keyword returns the name of the previously registered
39
-
failure keyword. It can be used to restore the original
40
-
value later.
42
+
failure keyword or Python ``None`` if this functionality was
43
+
previously disabled. The return value can be always used to
44
+
restore the original value later.
41
45
42
46
Example:
43
47
| Register Keyword To Run On Failure | Log Source | # Run `Log Source` on failure. |
44
48
| ${previous kw}= | Register Keyword To Run On Failure | Nothing | # Disables run-on-failure functionality and stores the previous kw name in a variable. |
45
49
| Register Keyword To Run On Failure | ${previous kw} | # Restore to the previous keyword. |
0 commit comments