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