差異處
這裏顯示兩個版本的差異處。
rf:rf:upgrade:3.0to3.1.2 [2019/11/17 11:02] tony 建立 |
rf:rf:upgrade:3.0to3.1.2 [2023/06/25 09:48] |
||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== 升級RobotFramework從3.0到3.1.2 ====== | ||
- | ===== Square brackets after variable like ${var}[xxx] is considered item access ===== | ||
- | 升級後的錯誤訊息會類似這樣: | ||
- | <code bash> | ||
- | Variable '${phymemory_tabletr_xpath_prefix}' is string, not list or dictionary, and thus accessing item '2' from it is not possible. | ||
- | </code> | ||
- | 原本的語法如下: | ||
- | <code bash> | ||
- | ${phymemory_tabletr_xpath_prefix} | Set Variable | //table[@class='deviceTable']/tbody/tr | ||
- | ${speed_or_size_locator} | Set Variable | ${phymemory_tabletr_xpath_prefix}[2]/th[8] | ||
- | </code> | ||
- | Robot的[[https://github.com/robotframework/robotframework/issues/3004|issue]]有人和我遇到一樣問題,作者提供在index之前加入反斜線的改法: | ||
- | <code bash> | ||
- | ${phymemory_tabletr_xpath_prefix}[2]/th[8] | ||
- | 改為 | ||
- | ${phymemory_tabletr_xpath_prefix}\[2]/th[8] | ||
- | </code> | ||
- | |||