def get_application_root(context, application):
    """
    Get Accessibility object of an application, based upon given name.

    :type context: <behave.runner.Context>
    :param context: Context object that is passed from common steps.

    :type application: str
    :param application: String of application identification: name.

    :rtype: <dogtail.tree.root.application>
    :return: Return root object of application.

    .. note::

        Do **NOT** call this by yourself. This function is called by :mod:`common_steps`.
    """
    from dogtail.tree import root
    try:
        root_to_return = root.application(application)
    except Exception:
        assert False, 'Application was not found in accessibility. Check your environment or feature file!'
    return root_to_return
