robotframework-debug


Namerobotframework-debug JSON
Version 4.5.0 PyPI version JSON
download
home_pagehttps://github.com/imbus/robotframework-debug/
SummaryRobotFramework debug shell
upload_time2024-03-30 19:21:13
maintainerNone
docs_urlNone
authorRené Rohner
requires_python>=3.8.0
licenseNew BSD
keywords robotframework debug shell repl
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            Debug Library for Robot Framework
=================================

.. contents::
   :local:

Introduction
------------

This Library is a Fork by René Rohner from the original robotframework-debuglibrary by Xie Yanbo


Robotframework-RobotDebug is a debug library for `RobotFramework`_,
which can be used as an interactive shell(REPL) also.

.. _`RobotFramework`: http://robotframework.org


Installation
------------

To install using ``pip``::

    pip install robotframework-debug

Usage
-----

You can use this as a library, import ``RobotDebug`` and call ``Debug`` keyword in your test files like this::

    *** Settings ***
    Library         RobotDebug

    ** test case **
    SOME TEST
        # some keywords...
        Debug
        # some else...
        ${count} =  Get Element Count  name:div_name


Or you can run it standalone as a ``RobotFramework`` shell::

    $ irobot
    [...snap...]
    >>>>> Enter interactive shell
    > help
    Input Robotframework keywords, or commands listed below.
    Use "libs" or "l" to see available libraries,
    use "keywords" or "k" to see the list of library keywords,
    use the TAB keyboard key to autocomplete keywords.

    Documented commands (type help <topic>):
    ========================================
    EOF  continue  docs  help  keywords  libs  ll        n     pdb  selenium
    c    d         exit  k     l         list  longlist  next  s    step
    > log  hello
    > get time
    < '2011-10-13 18:50:31'
    > # use TAB to auto complete commands
    > BuiltIn.Get Time
    < '2011-10-13 18:50:39'
    > import library  String
    > get substring  helloworld  5  8
    < 'wor'
    > # define variables as you wish
    > ${secs} =  Get Time  epoch
    # ${secs} = 1474814470
    > Log to console  ${secs}
    1474814470
    > @{list} =  Create List    hello    world
    # @{list} = ['hello', 'world']
    > Log to console  ${list}
    ['hello', 'world']
    > &{dict} =  Create Dictionary    name=admin    email=admin@test.local
    # &{dict} = {'name': 'admin', 'email': 'admin@test.local'}
    > Log  ${dict.name}
    > # print value if you input variable name only
    > ${list}
    [u'hello', u'world']
    > ${dict.name}
    admin
    > exit
    >>>>> Exit shell.

The interactive shell support auto-completion for robotframework keywords and
commands. Try input ``BuiltIn.`` then hit ``Control + Space`` key to feeling it.

The history will save at ``~/.rfdebug_history`` default or any file
defined in environment variable ``RFDEBUG_HISTORY``.

In case you don't remember the name of keyword during using ``irobot``,
there are commands ``libs`` or ``ls`` to list the imported libraries and
built-in libraries, and ``keywords <lib name>`` or ``k`` to list
keywords of a library.

``irobot`` accept any ``robot`` arguments, but by default, ``rfdebug``
disabled all logs with ``-l None -x None -o None -L None -r None``.

Step debugging
**************

``RobotDebug`` support step debugging since version ``2.1.0``.
You can use ``step``/``s``, ``next``/``n``, ``continue``/``c``,
``list``/``l`` and ``longlist``/``ll`` to trace and view the code
step by step like in ``pdb``::

    $ robot some.robot
    [...snap...]
    >>>>> Enter interactive shell
    > l
    Please run `step` or `next` command first.
    > s
    .> /Users/xyb/some.robot(7)
    -> log to console  hello
    => BuiltIn.Log To Console  hello
    > l
      2   	Library  RobotDebug
      3
      4   	** test case **
      5   	test
      6   	    debug
      7 ->	    log to console  hello
      8   	    log to console  world
    > n
    hello
    .> /Users/xyb/some.robot(8)
    -> log to console  world
    => BuiltIn.Log To Console  world
    > c
    >>>>> Exit shell.
    world

Note: Single-step debugging does not support ``FOR`` loops currently.

Submitting issues
-----------------

Bugs and enhancements are tracked in the `issue tracker
<https://github.com/imbus/robotframework-debug/issues>`_.

Before submitting a new issue, it is always a good idea to check is the
same bug or enhancement already reported. If it is, please add your comments
to the existing issue instead of creating a new one.

Development
-----------

If you want to develop and run RobotDebug locally, you can use ::

    $ python RobotDebug/shell.py tests/step.robot

`shell.py` is calling `robot` through a child process, so it will interrupt
python debugging capabilities. If you want to debug in tools like vscode,
pdb, you should run ::

    $ python -m robot tests/step.robot

If you want to run the test, please install the dependency packages first
and then execute the test ::

    $ python setup.py develop
    $ python setup.py test

Since RF takes over stdout, debugging information can be output with ::

    import sys
    print('some information', file=sys.stdout)

License
-------

This software is licensed under the ``New BSD License``. See the ``LICENSE``
file in the top distribution directory for the full license text.

.. # vim: syntax=rst expandtab tabstop=4 shiftwidth=4 shiftround

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/imbus/robotframework-debug/",
    "name": "robotframework-debug",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8.0",
    "maintainer_email": null,
    "keywords": "robotframework, debug, shell, repl",
    "author": "Ren\u00e9 Rohner",
    "author_email": "snooz@postoe.de",
    "download_url": "https://files.pythonhosted.org/packages/33/c9/80ca51bc6528c4255e3a62846879d5b14e305b2c68ad49bba75a7ac23a04/robotframework-debug-4.5.0.tar.gz",
    "platform": "Linux",
    "description": "Debug Library for Robot Framework\n=================================\n\n.. contents::\n   :local:\n\nIntroduction\n------------\n\nThis Library is a Fork by Ren\u00e9 Rohner from the original robotframework-debuglibrary by Xie Yanbo\n\n\nRobotframework-RobotDebug is a debug library for `RobotFramework`_,\nwhich can be used as an interactive shell(REPL) also.\n\n.. _`RobotFramework`: http://robotframework.org\n\n\nInstallation\n------------\n\nTo install using ``pip``::\n\n    pip install robotframework-debug\n\nUsage\n-----\n\nYou can use this as a library, import ``RobotDebug`` and call ``Debug`` keyword in your test files like this::\n\n    *** Settings ***\n    Library         RobotDebug\n\n    ** test case **\n    SOME TEST\n        # some keywords...\n        Debug\n        # some else...\n        ${count} =  Get Element Count  name:div_name\n\n\nOr you can run it standalone as a ``RobotFramework`` shell::\n\n    $ irobot\n    [...snap...]\n    >>>>> Enter interactive shell\n    > help\n    Input Robotframework keywords, or commands listed below.\n    Use \"libs\" or \"l\" to see available libraries,\n    use \"keywords\" or \"k\" to see the list of library keywords,\n    use the TAB keyboard key to autocomplete keywords.\n\n    Documented commands (type help <topic>):\n    ========================================\n    EOF  continue  docs  help  keywords  libs  ll        n     pdb  selenium\n    c    d         exit  k     l         list  longlist  next  s    step\n    > log  hello\n    > get time\n    < '2011-10-13 18:50:31'\n    > # use TAB to auto complete commands\n    > BuiltIn.Get Time\n    < '2011-10-13 18:50:39'\n    > import library  String\n    > get substring  helloworld  5  8\n    < 'wor'\n    > # define variables as you wish\n    > ${secs} =  Get Time  epoch\n    # ${secs} = 1474814470\n    > Log to console  ${secs}\n    1474814470\n    > @{list} =  Create List    hello    world\n    # @{list} = ['hello', 'world']\n    > Log to console  ${list}\n    ['hello', 'world']\n    > &{dict} =  Create Dictionary    name=admin    email=admin@test.local\n    # &{dict} = {'name': 'admin', 'email': 'admin@test.local'}\n    > Log  ${dict.name}\n    > # print value if you input variable name only\n    > ${list}\n    [u'hello', u'world']\n    > ${dict.name}\n    admin\n    > exit\n    >>>>> Exit shell.\n\nThe interactive shell support auto-completion for robotframework keywords and\ncommands. Try input ``BuiltIn.`` then hit ``Control + Space`` key to feeling it.\n\nThe history will save at ``~/.rfdebug_history`` default or any file\ndefined in environment variable ``RFDEBUG_HISTORY``.\n\nIn case you don't remember the name of keyword during using ``irobot``,\nthere are commands ``libs`` or ``ls`` to list the imported libraries and\nbuilt-in libraries, and ``keywords <lib name>`` or ``k`` to list\nkeywords of a library.\n\n``irobot`` accept any ``robot`` arguments, but by default, ``rfdebug``\ndisabled all logs with ``-l None -x None -o None -L None -r None``.\n\nStep debugging\n**************\n\n``RobotDebug`` support step debugging since version ``2.1.0``.\nYou can use ``step``/``s``, ``next``/``n``, ``continue``/``c``,\n``list``/``l`` and ``longlist``/``ll`` to trace and view the code\nstep by step like in ``pdb``::\n\n    $ robot some.robot\n    [...snap...]\n    >>>>> Enter interactive shell\n    > l\n    Please run `step` or `next` command first.\n    > s\n    .> /Users/xyb/some.robot(7)\n    -> log to console  hello\n    => BuiltIn.Log To Console  hello\n    > l\n      2   \tLibrary  RobotDebug\n      3\n      4   \t** test case **\n      5   \ttest\n      6   \t    debug\n      7 ->\t    log to console  hello\n      8   \t    log to console  world\n    > n\n    hello\n    .> /Users/xyb/some.robot(8)\n    -> log to console  world\n    => BuiltIn.Log To Console  world\n    > c\n    >>>>> Exit shell.\n    world\n\nNote: Single-step debugging does not support ``FOR`` loops currently.\n\nSubmitting issues\n-----------------\n\nBugs and enhancements are tracked in the `issue tracker\n<https://github.com/imbus/robotframework-debug/issues>`_.\n\nBefore submitting a new issue, it is always a good idea to check is the\nsame bug or enhancement already reported. If it is, please add your comments\nto the existing issue instead of creating a new one.\n\nDevelopment\n-----------\n\nIf you want to develop and run RobotDebug locally, you can use ::\n\n    $ python RobotDebug/shell.py tests/step.robot\n\n`shell.py` is calling `robot` through a child process, so it will interrupt\npython debugging capabilities. If you want to debug in tools like vscode,\npdb, you should run ::\n\n    $ python -m robot tests/step.robot\n\nIf you want to run the test, please install the dependency packages first\nand then execute the test ::\n\n    $ python setup.py develop\n    $ python setup.py test\n\nSince RF takes over stdout, debugging information can be output with ::\n\n    import sys\n    print('some information', file=sys.stdout)\n\nLicense\n-------\n\nThis software is licensed under the ``New BSD License``. See the ``LICENSE``\nfile in the top distribution directory for the full license text.\n\n.. # vim: syntax=rst expandtab tabstop=4 shiftwidth=4 shiftround\n",
    "bugtrack_url": null,
    "license": "New BSD",
    "summary": "RobotFramework debug shell",
    "version": "4.5.0",
    "project_urls": {
        "Homepage": "https://github.com/imbus/robotframework-debug/"
    },
    "split_keywords": [
        "robotframework",
        " debug",
        " shell",
        " repl"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "15a926171e61d8e2315c8c59a12206b6a4e5a313fcb834f186b2c9c3267ba47c",
                "md5": "ef72bf2b2803fa7866efc303e8b6f403",
                "sha256": "7591c3418016a0356158c43e47548a9e9c4ca1ac51b33d7267fccf4153c0952e"
            },
            "downloads": -1,
            "filename": "robotframework_debug-4.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ef72bf2b2803fa7866efc303e8b6f403",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8.0",
            "size": 27496,
            "upload_time": "2024-03-30T19:21:11",
            "upload_time_iso_8601": "2024-03-30T19:21:11.595713Z",
            "url": "https://files.pythonhosted.org/packages/15/a9/26171e61d8e2315c8c59a12206b6a4e5a313fcb834f186b2c9c3267ba47c/robotframework_debug-4.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "33c980ca51bc6528c4255e3a62846879d5b14e305b2c68ad49bba75a7ac23a04",
                "md5": "ad49d7fbf99d17748444a0c832fb96bd",
                "sha256": "925d830cd7c17d578d9822bfb969147d153da057369e31a17e205144a368e8a4"
            },
            "downloads": -1,
            "filename": "robotframework-debug-4.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ad49d7fbf99d17748444a0c832fb96bd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.0",
            "size": 31006,
            "upload_time": "2024-03-30T19:21:13",
            "upload_time_iso_8601": "2024-03-30T19:21:13.634264Z",
            "url": "https://files.pythonhosted.org/packages/33/c9/80ca51bc6528c4255e3a62846879d5b14e305b2c68ad49bba75a7ac23a04/robotframework-debug-4.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-30 19:21:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "imbus",
    "github_project": "robotframework-debug",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "robotframework-debug"
}
        
Elapsed time: 0.21771s