robotframework调试库和一个交互式shell

robotframework-debuglibrar的Python项目详细描述


Introduction

robotframework debug library是RobotFramework的调试库, 它也可以用作交互式shell(repl)。

Installation

使用pip

安装
pip install robotframework-debuglibrary

Usage

您可以将其用作库,导入DebugLibrary并调用Debug 测试文件中的关键字如下:

*** Settings ***
Library         DebugLibrary

** test case **
SOME TEST
    # some keywords...
    Debug

或者可以作为RobotFrameworkshell单独运行它:

$ rfdebug
[...snap...]
>>>>> Enter interactive shell, only accepted plain text format keyword.
> 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  exit  help  k  keywords  l  libs  pdb  s  selenium

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

交互式shell支持自动完成robotframework关键字和 命令。尝试输入BuiltIn.,然后键入<TAB>键来感受它。 历史记录将保存在~/.rfdebug_historydefault或任何文件 在环境变量RFDEBUG_HISTORY中定义。

如果在使用rfdebug期间不记得关键字的名称, 有命令libsl列出导入的库和 内置库和keywords <lib name>k列表 图书馆的关键字。

rfdebug接受任何pybot参数,但默认情况下,rfdebug 使用-l None -x None -o None -L None -r None禁用所有日志。

Submitting issues

缺陷和增强在issue tracker中跟踪。

在提交新版本之前,最好检查 已报告相同的错误或增强。如果是,请添加您的评论 对现有的问题,而不是创造一个新的问题。

License

此软件是根据New BSD License授权的。参见LICENSE 文件位于顶级分发目录中,以获取完整的许可证文本。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Apache Flink外部Jar   创建和强制转换对象数组时发生java错误   Java,添加数组   具有相同包结构和类的java JAR   java Jenkins未能构建Maven项目   java为什么一个forloop比另一个更快,尽管它们做的“一样”?   servlets在将“/”站点迁移到Java EE包时处理contextpath引用   无法解析java MavReplugin:2.21或其某个依赖项   泛型如何编写比较器来泛化Java中的两种类型的对象?   java Android Emulator未在netbeans上加载   多线程Java使用线程对数组中的数字求和:在同步块中使用新变量作为锁:差异   java如何在JSP/servlet中设置<input>标记的值?