cumulusci.robotframework package


class cumulusci.robotframework.CumulusCI.CumulusCI(org_name=None)[source]

Bases: object

Library for accessing CumulusCI for the local git project

This library allows Robot Framework tests to access credentials to a Salesforce org created by CumulusCI, including Scratch Orgs. It also exposes the core logic of CumulusCI including interactions with the Salesforce API’s and project specific configuration including custom and customized tasks and flows.

Initialization requires a single argument, the org name for the target CumulusCI org. If running your tests via cci’s robot task (recommended), you can initialize the library in your tests taking advantage of the variable set by the robot task: | *** Settings *** | | Library cumulusci.robotframework.CumulusCI ${ORG}


Pauses execution and enters the Python debugger.

get_community_info(community_name, key=None, force_refresh=False)[source]

This keyword uses the Salesforce API to get information about a community.

This keyword requires the exact community name as its first argumment.

  • If no key is given, all of the information returned by the API will be returned by this keyword in the form of a dictionary
  • If a key is given, only the value for that key will be returned.

Some of the supported keys include name, siteUrl, and loginUrl. For a comprehensive list see the [|API documentation], or call this keyword without the key argument and examine the results.

An API call will be made the first time this keyword is used, and the return values will be cached. Subsequent calls will not call the API unless the requested community name is not in the cached results, or unless the force_refresh parameter is set to True.


Returns the namespace prefix (including __) for the specified package name. (Defaults to project__package__name_managed from the current project config.)

Returns an empty string if the package is not installed as a managed package.


Returns a dictionary of the org information for the current target Salesforce org


Returns the login url which will automatically log into the target Salesforce org. By default, the org_name passed to the library constructor is used but this can be overridden with the org option to log into a different org.

run_task(task_name, **options)[source]

Runs a named CumulusCI task for the current project with optional support for overriding task options via kwargs.

Examples: | =Keyword= | =task_name= | =task_options= | =comment= | | Run Task | deploy | | Run deploy with standard options | | Run Task | deploy | path=path/to/some/metadata | Run deploy with custom path |

run_task_class(class_path, **options)[source]

Runs a CumulusCI task class with task options via kwargs.

Use this keyword to run logic from CumulusCI tasks which have not been configured in the project’s cumulusci.yml file. This is most useful in cases where a test needs to use task logic for logic unique to the test and thus not worth making into a named task for the project

Examples: | =Keyword= | =task_class= | =task_options= | | Run Task Class | cumulusci.task.utils.DownloadZip | url= dir=test_zip |


Sets the LOGIN_URL variable in the suite scope which will automatically log into the target Salesforce org.

Typically, this is run during Suite Setup


Call selenium’s add_location_strategy keyword for all strategies

cumulusci.robotframework.locator_manager.locate_element(prefix, parent, locator, tag, constraints)[source]

This is the function called by SeleniumLibrary when a custom locator strategy is used (eg: We pass an additional argument, prefix, so we know which set of locators to use.

This tokenizes the locator and then does a lookup in the dictionary associated with the given prefix. If any arguments are present, they are applied with .format() before being used to find an element.

cumulusci.robotframework.locator_manager.register_locators(prefix, locators)[source]

Register a strategy with a set of locators or a keyword

If the prefix is already known, merge in the new locators.

cumulusci.robotframework.locator_manager.translate_locator(prefix, locator)[source]

Return the translated locator

This uses the passed-in prefix and locator to find the proper element in the LOCATORS dictionary, and then formats it with any arguments that were part of the locator.

class cumulusci.robotframework.utils.RetryingSeleniumLibraryMixin[source]

Bases: object

debug = False
selenium_execute_with_retry(execute, command, params)[source]

Run a single selenium command and retry once.

The retry happens for certain errors that are likely to be resolved by retrying.



This script polls Aura via $A in Javascript to determine when all in-flight XHTTP requests have completed before continuing.


Decorator for capturing a screenshot if a keyword throws an error

The name is slightly misleading. While it was designed to capture a screenshot on error, it actually ties in to the same feature in SeleniumLibrary.

SeleniumLibrary lets you define any keyword to be run on error, though I doubt we would ever use it for anything other than to capture screenshots. However, if you do configure SeleniumLibrary to do something other than (or in addition to) capturing a screenshot, any keyword that uses this decorator will behave just like a SeleniumLibrary keyword.

cumulusci.robotframework.utils.selenium_retry(target=None, retry=True)[source]

Decorator to turn on automatic retries of flaky selenium failures.

Decorate a robotframework library class to turn on retries for all selenium calls from that library:

class MyLibrary(object):

    # Decorate a method to turn it back off for that method
    def some_keyword(self):

Or turn it off by default but turn it on for some methods (the class-level decorator is still required):

class MyLibrary(object):

    def some_keyword(self):

Start the Python debugger when robotframework is running.

This makes sure that pdb can use stdin/stdout even though robotframework has redirected I/O.

Module contents