cumulusci.tasks.robotframework.debugger package


Robot Debugger

class cumulusci.tasks.robotframework.debugger.DebugListener.DebugListener(*breakpoints)[source]

Bases: object

A robot framework listener for debugging test cases

This acts as the controller for the debugger. It is responsible for managing breakpoints, and pausing execution of a test when a breakpoint is hit.

The listener is also responsible for instantiating the debugger UI (class DebuggerCli).


Pause test execution and issue a prompt if we are at a breakpoint


Single-step through the code

This will set a temporary breakpoint on the next keyword in the current context before continuing. Once the breakpoint is hit, it will be removed from the list of breakpoints.

end_keyword(name, attrs)[source]
end_suite(name, attrs)[source]
end_test(name, attrs)[source]
start_keyword(name, attrs)[source]
start_suite(name, attrs)[source]
start_test(name, attrs)[source]
class cumulusci.tasks.robotframework.debugger.model.Base(name, attrs)[source]

Bases: object

Base class for keywords, testcases, and suites

This is mainly used to store the data passed to use from the listener methods.

class cumulusci.tasks.robotframework.debugger.model.Breakpoint(breakpoint_type, pattern, temporary=False)[source]

Bases: object

A breakpoint

  • breakpoint_type – class of object to break on; currently only Keyword is supported. Eventually I want to support setting breakpoints when a suite or test case is first started, before any keywords run.
  • pattern – glob-style pattern to match against the current step
  • temporary – if True, the breakpoint is removed once it triggers. Used for setting temporary breakpoints for stepping through the code

Note: when a breakpoint is encountered, a string will be formed with the fully qualified name of the current testcase and the fully qualified name of the current keyword, separated with “::”

The breakpoint pattern will be matched against this string.

Root_suite.sub_suite.a test case::BuiltIn.log

To break on the “Salesforce.breakpoint” keyword in any test, the breakpoint could use any one of these patterns depending on how precise you want to be:

  • *::cumulusci.robotframework.Salesforce.Breakpoint
  • *::*.Breakpoint
  • *.Breakpoint

Return True if the breakpoint matches the current context

class cumulusci.tasks.robotframework.debugger.model.Keyword(name, attrs)[source]

Bases: cumulusci.tasks.robotframework.debugger.model.Base

class cumulusci.tasks.robotframework.debugger.model.Suite(name, attrs)[source]

Bases: cumulusci.tasks.robotframework.debugger.model.Base

class cumulusci.tasks.robotframework.debugger.model.Testcase(name, attrs)[source]

Bases: cumulusci.tasks.robotframework.debugger.model.Base

class cumulusci.tasks.robotframework.debugger.ui.DebuggerCli(listener, stdout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]

Bases: cmd.Cmd, object


Ignore lines that begin with #


Let the test continue


Find and highlight all elements that match the given selenium locator


rdb> locate_elements //button[@title=’Learn More’]

Start pdb

The context will be this function, which won’t be particularly useful. This is mostly for debugging the debug code. How meta!


Cause robot to quit gracefully (all remaining tests will be skipped)


Remove all highlighting added by locate_elements


Execute a robot framework keyword. (shortcut: !)

The statement should be formatted just like in a .robot file, with two spaces between each argument.


rdb> shell log hello, world -or- rdb> ! log hello, world

Variables can be specified the same as in a robot file. For example, this will set a test variable named ${location}:

rdb> shell ${location} get location

Run the next step in the test

This will run the line where the test is currently paused, and then stop at the next keyword in the same test case.


Print the value of all known variables


Print the current robot stack (hierarchy of suites and tests, ending with the current keyword

intro = '\n:::\n::: Welcome to rdb, the Robot Framework debugger\n:::\n\nType help or ? to list commands.\n'
prompt = 'rdb> '

Module contents