【发布时间】:2015-05-04 09:58:46
【问题描述】:
我有这个代码:基本上我正在尝试遍历这个键盘字典并根据传入的变量,点击相应的密码键。
| Create a new Passcode
| | [Documentation] | test
| | @{Passcode} = | Create List | 1 | 2 | 3 | 4
| | Enter the passcode | ${Passcode}
| Enter the passcode
| | [arguments] | @{Keys}
| | ${keypadDictionary} | Create Dictionary
| | ... | 0 | keypad-zero
| | ... | 1 | keypad-one
| | ... | 2 | keypad-two
| | ... | 3 | keypad-three
| | ... | 4 | keypad-four
| | ... | 5 | keypad-five
| | ... | 6 | keypad-six
| | ... | 7 | keypad-seven
| | ... | 8 | keypad-eight
| | ... | 9 | keypad-nine
| | wait for screen to contain element | ${Passcode screen}
| | :FOR | ${Key} | IN | @{Keys}
| | | Tap | ${keypadDictionary['${Key}']}
我收到此错误:
Resolving variable '${keypadDictionary['[u'1', u'2', u'3', u'4']']}' failed: SyntaxError:
invalid syntax (<string>, line 1)
我不知道为什么。
【问题讨论】:
标签: python appium robotframework