robotframework调试库和一个交互式shell
robotframework-debuglibrar的Python项目详细描述
Introduction
robotframework debug library是RobotFramework的调试库, 它也可以用作交互式shell(repl)。
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期间不记得关键字的名称, 有命令libs或l列出导入的库和 内置库和keywords <lib name>或k列表 图书馆的关键字。
rfdebug接受任何pybot参数,但默认情况下,rfdebug 使用-l None -x None -o None -L None -r None禁用所有日志。
License
此软件是根据New BSD License授权的。参见LICENSE 文件位于顶级分发目录中,以获取完整的许可证文本。