引言:什么是RFS――RobotFramework+Selenium2library,本系列主要介绍web自动化验收测试方面。
( @齐涛-道长 新浪微博)
9月6日的时候robotframework的官网(http://code.google.com/p/robotframework/)发布了RF2.7.4版本,有需要的朋友可以升级一下。
更新说明:http://code.google.com/p/robotframework/wiki/ReleaseNotes27#Robot_Framework_2.7.4
第一眼就看到的是开始支持ELSE和ELSE IF分支语句了,眼前一亮~终于可以进一步完善脚本了,这样有了FOR-LOOP,又有了Else和Else if,循环和分支就齐全了。
${ret} = | Run Keyword If | ${rc} == 0 | Handle Zero Return Value | |
... | ELSE IF | ${rc} < 0 | Handle Negative Return Value | ${rc} |
... | ELSE | Handle Positive Return Value | ${rc} | second arg |
另一个是增加了一个XML的库,支持XML的一些方法,以前他也能支持,不过要另外单独下载,这次直接包含到RF里面了。
PS:RIDE0.50也悄无声息的在9月11日发布了,看到俺提的那个bug修复了,下载地址https://github.com/robotframework/RIDE/downloads
附原文:
Robot Framework 2.7.4
Robot Framework 2.7.4 is a bigger-than-normal minor release that brings some really nice new enhancements and some bug fixes. It was released on Thursday 6th of September, 2012.
Most important enhancements
New library for verifying XML contents
New standard library XML makes verifying XML contents with Robot Framework easy ( issue 1196 ). This library works also with earlier 2.7 versions, but needs to be downloaded separately.
Enhanced statistics
Statistics nowadays contain elapsed times per suite and per tag ( issue 1194 ) to make it easier to monitor which tests take most time. Elapsed times also have their own column in test details ( issue 1206 ) to ease further investigation.
Statistics are also sortable, for example, by elapsed times ( issue 1199 ). A small but convenient new feature is that clicking anywhere in the statistics row, as well as in test detail row, navigates to more details ( issue 1200 ). No need to move mouse over the tag, suite, or test name before clicking.
ELSE and ELSE IF support for Run Keyword If keyword
It is easier to create if/else constructs now that Run Keyword If has built-in support for them ( issue 1219 ). This is especially handy when you want to get the return value of the actually executed keyword:
${ret} = | Run Keyword If | ${rc} == 0 | Handle Zero Return Value | |
... | ELSE IF | ${rc} < 0 | Handle Negative Return Value | ${rc} |
... | ELSE | Handle Positive Return Value | ${rc} | second arg |
Potentially backwards-incompatible changes
It is possible, but very unlikely, that the changes listed below could cause backwards-compatibility problems.
- Modifying tags test have is not anymore possible by altering ${TEST TAGS} variable ( issue 1215 ).
- Return value of Get Variables is a normal dictionary and not a custom object with access to internals of the framework ( issue 1180 ).
- Because ELSE and ELSE IF have special meaning Run Keyword If ( issue 1219 ), using them as literal strings requires escaping like\ELSE.
- New automatic variables ${SUITE METADATA} ( issue 1134 ) may overwrite variable with same name used otherwise in test data.
Full list of enhancements and fixes
ID | Type | Priority | Summary |
Issue 1196 | Enhancement | Critical | New library for verifying XML contents |
Issue 1164 | Defect | High | Log and report can break if test data contains text </script> |
Issue 1194 | Enhancement | High | Run times per suite and per tag should be shown in statistics |
Issue 1199 | Enhancement | High | Sortable statistics |
Issue 1206 | Enhancement | High | Separate column for elapsed time in report's test details table to allow sorting by it |
Issue 1219 | Enhancement | High | ELSE and ELSE IF support for Run Keyword If |
Issue 1165 | Defect | Medium | Error message when creating log or report fails doesn't have enough information |
Issue 1176 | Defect | Medium | Stop Process cannot be used to "stop" a process anymore |
Issue 1180 | Defect | Medium | The return value of the BuiltIn library's Get Variables keyword cannot be used like normal dictionary |
Issue 1190 | Defect | Medium | times2csv.py does not handle non-ASCII characters |
Issue 1191 | Defect | Medium | Trying to use Java class without public constructor as test library crashes execution |
Issue 1192 | Defect | Medium | Linking to warnings in log files does not work when using --SplitLog option |
Issue 1212 | Defect | Medium | Errors happening in Python's logging module should not fail a test case |
Issue 1134 | Enhancement | Medium | Add Set Suite Metadata keyword and ${SUITE METADATA} variable |
Issue 1184 | Enhancement | Medium | Better reporting when using invalid command line options |
Issue 1200 | Enhancement | Medium | Navigate to destination by clicking anywhere in statistics and test detail rows in log/report |
Issue 1210 | Enhancement | Medium | Tidy tool (and parsing modules) should preserve standalone comments in variable table |
Issue 1220 | Enhancement | Medium | --MonitorMarkers option to control are . and F used on console when top-level keywords end |
Issue 1163 | Defect | Low | HTML formatted tables do not anymore have border="1" attribute |
Issue 1211 | Defect | Low | Small problems showing total, tag, or suite name when printing tests in report |
Issue 1213 | Defect | Low | Libdoc does not differentiate varargs from normal arguments with Java libraries |
Issue 1215 | Defect | Low | Modifying ${TEST TAGS} should not affect actual tags tests have |
Issue 1166 | Enhancement | Low | New @{EMPTY} variable |
Issue 1174 | Enhancement | Low | Documentation formatting: Allow splitting list items into multiple lines by indenting continuing lines |
Issue 1177 | Enhancement | Low | Keywords in Collections for comparing lists and dictionaries should report errors better when items look same but have different type |
Issue 1218 | Enhancement | Low | Allow modifying test tags with Fail keyword |
Altogether 26 issues.