All Projects → xyb → robotframework-debuglibrary

xyb / robotframework-debuglibrary

Licence: other
A debug library for RobotFramework, which can be used as an interactive shell(REPL) also.

Programming Languages

python
139335 projects - #7 most used programming language
RobotFramework
109 projects

Projects that are alternatives of or similar to robotframework-debuglibrary

robotframework-jsonvalidator
Robot Framework library for JSON validation
Stars: ✭ 21 (-78.12%)
Mutual labels:  robotframework
solidity-shell
An interactive Solidity Shell
Stars: ✭ 434 (+352.08%)
Mutual labels:  repl
soar-php
SQL optimizer and rewriter. - SQL 优化、重写器(辅助 SQL 调优)。
Stars: ✭ 140 (+45.83%)
Mutual labels:  debug
plasma
A declarative, immediate mode UI widget library for Roblox.
Stars: ✭ 35 (-63.54%)
Mutual labels:  debug
logserver
web log viewer that combines logs from several sources
Stars: ✭ 20 (-79.17%)
Mutual labels:  debug
backend debug
Debug support in TYPO3 backend
Stars: ✭ 20 (-79.17%)
Mutual labels:  debug
react-native-startup-time
measure startup time of your react-native app
Stars: ✭ 88 (-8.33%)
Mutual labels:  debug
composer-repl
A REPL for PHP built into Composer (using PsySH)
Stars: ✭ 81 (-15.62%)
Mutual labels:  repl
klipse-repl
Beginners friendly Clojure REPL
Stars: ✭ 44 (-54.17%)
Mutual labels:  repl
d3-fdg-svelte
d3 Force Directed Graph example (d3-force) implemented in sveltejs. REPL:
Stars: ✭ 31 (-67.71%)
Mutual labels:  repl
s7-imgui
Using s7 scheme alongside Dear ImGui to (interactively) build (cross platform) GUI apps.
Stars: ✭ 29 (-69.79%)
Mutual labels:  repl
openrepl
OpenRepl REPL
Stars: ✭ 27 (-71.87%)
Mutual labels:  repl
UnitySettings
Runtime debugging menu (like setting on Android) for Unity.
Stars: ✭ 26 (-72.92%)
Mutual labels:  debug
tracelog
TraceLog is a highly configurable, flexible, portable, and simple to use debug logging system for Swift and Objective-C applications running on Linux, macOS, iOS, watchOS, and tvOS.
Stars: ✭ 52 (-45.83%)
Mutual labels:  debug
SQLite.viewer
An elegant library for debugging sqlite databases in iOS applications
Stars: ✭ 73 (-23.96%)
Mutual labels:  debug
robotframework-zoomba
Extended Robot Framework libraries to make testing GUI, REST/SOAP API, Mobile, and Windows Desktop easier.
Stars: ✭ 121 (+26.04%)
Mutual labels:  robotframework
live-platform
Add breakpoints, logs, metrics, and spans to live production applications
Stars: ✭ 37 (-61.46%)
Mutual labels:  debug
debug
A small debugging library for C++
Stars: ✭ 30 (-68.75%)
Mutual labels:  debug
pdbfetch
Fetch PDB symbols directly from Microsoft's symbol servers
Stars: ✭ 33 (-65.62%)
Mutual labels:  debug
klisp
A Lisp written in about 200 lines of Ink, featuring an interactive literate programming notebook
Stars: ✭ 28 (-70.83%)
Mutual labels:  repl

Debug Library for Robot Framework

Introduction

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

Maintainability Test Coverage test Latest version Support robotframework versions Support python versions PyPI Downloads License

Installation

To install using pip:

pip install robotframework-debuglibrary

NOTICE: 2.0 is not compatible with python 2

DebugLibrary >= 2.0.0 supports Python versions 3.x only. If you still using python 2.7, please use DebugLibrary < 2.0.0

pip install 'robotframework-debuglibrary<2'

Usage

You can use this as a library, import DebugLibrary and call Debug or Debug If keywords 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} < 1

Or you can run it standalone as a RobotFramework shell:

$ 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 protected]
# &{dict} = {'name': 'admin', 'email': '[email protected]'}
> 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 input BuiltIn. then type <TAB> 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 rfdebug, 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.

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

Step debugging

DebugLibrary 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  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.
world

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

Submitting issues

Bugs and enhancements are tracked in the issue 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.

Development

If you want to develop and run DebugLibrary locally, you can use

$ python DebugLibrary/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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].