差異處
這裏顯示兩個版本的差異處。
rf:rf:upgrade:3.0to3.1.2 [2019/11/17 18:34] tony [Escaping empty cells with '\' before line continuation marker '...' is deprecated. Remove escaping before Robot Framework 3.2.] |
rf:rf:upgrade:3.0to3.1.2 [2023/06/25 09:48] |
||
---|---|---|---|
行 1: | 行 1: | ||
- | {{tag>RobotFramework}} | ||
- | ====== 升級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> | ||
- | 應該是3.1版本的內容: [[https://github.com/robotframework/robotframework/blob/master/doc/releasenotes/rf-3.1b1.rst#other-issues-possibly-causing-backwards-incompatibility-problems|link]]。 | ||
- | ===== Escaping empty cells with '\' before line continuation marker '...' is deprecated. Remove escaping before Robot Framework 3.2. ===== | ||
- | 目前作者認為...是奇怪的語法,打算在3.2中廢掉它,可以參考[[https://github.com/robotframework/robotframework/issues/3148|issue 3148]];而我們最常會遇到的地方是在:For中較長的內容會透過反斜線加...去銜接。\\ | ||
- | \\ | ||
- | 另外在3.3要廢掉:FOR語法,改用FOR+END去替代它,可以參考[[https://github.com/robotframework/robotframework/issues/3078|issue 3078。\\ | ||
- | \\ | ||
- | 在FOR LOOP中,這個問題的解法就是使用FOR+END去取代原本的寫法;但不幸地,我目前用1.7.3的RIDE,會幫我把FOR變回:FOR。\\ | ||
- | \\ | ||
- | 因此我決定,等之後再來研究這個問題。 | ||
- | |||
- | |||
- | |||