Package: robotframework-debuglibrary
IntroductionInstallationNOTICE: 2.0 is not compatible with python 2UsageStep debuggingSubmitting issuesDevelopmentLicenseIntroductionRobotframework-DebugLibrary is a debug library forRobotFramework,
which can be used as an interactive shell(REPL) also.InstallationTo install usingpip:pip install robotframework-debuglibraryNOTICE: 2.0 is not compatible with python 2DebugLibrary>= 2.0.0 supports Python versions 3.x only.
If you still using python 2.7, please useDebugLibrary< 2.0.0pip install 'robotframework-debuglibrary<2'UsageYou can use this as a library, importDebugLibraryand callDebugorDebug Ifkeywords in your test files like this:*** Settings ***
Library         DebugLibrary

** test case **
SOME TEST
    # some keywords...
    Debug
    # some else...
    ${count} =  Get Element Count  name:div_name
    Debug If  ${count} < 1Or you can run it standalone as aRobotFrameworkshell:$ rfdebug
[...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
> # start a selenium server quickly
> help selenium
Start a selenium webdriver and open url in browser you expect.

        s(elenium)  [<url>]  [<browser>]

        default url is google.com, default browser is firefox.
> selenium  google.com  chrome
# import library  SeleniumLibrary
# open browser  http://google.com  chrome
< 1
> close all browsers
> Ctrl-D
>>>>> Exit shell.The interactive shell support auto-completion for robotframework keywords and
commands. Try inputBuiltIn.then type<TAB>key to feeling it.
The history will save at~/.rfdebug_historydefault or any file
defined in environment variableRFDEBUG_HISTORY.In case you don’t remember the name of keyword during usingrfdebug,
there are commandslibsorlsto list the imported libraries and
built-in libraries, andkeywords <lib name>orkto list
keywords of a library.rfdebugaccept anypybotarguments, but by default,rfdebugdisabled all logs with-lNone-xNone-oNone-LNone-rNone.Step debuggingDebugLibrarysupport step debugging since version2.1.0.
You can usestep/s,next/n,continue/c,list/landlonglist/llto trace and view the code
step by step like inpdb:$ 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  DebugLibrary
  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.
worldNote: Single-step debugging does not supportFORloops currently.Submitting issuesBugs and enhancements are tracked in theissue tracker.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.DevelopmentIf you want to develop and run DebugLibrary locally, you can use$ python DebugLibrary/shell.py tests/step.robotshell.pyis callingrobotthrough 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.robotIf you want to run the test, please install the dependency packages first
and then execute the test$ python -m pip install setuptools
$ python setup.py develop
$ python setup.py testSince RF takes over stdout, debugging information can be output withimport sys
print('some information', file=sys.stdout)LicenseThis software is licensed under theNew BSD License. See theLICENSEfile in the top distribution directory for the full license text.