Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Robot框架下拉列表中的特殊字符(Selenium)_Selenium_Robotframework - Fatal编程技术网

Robot框架下拉列表中的特殊字符(Selenium)

Robot框架下拉列表中的特殊字符(Selenium),selenium,robotframework,Selenium,Robotframework,只是想知道你们中是否有人知道如何在包含下拉列表的网站上处理特殊字符。我在Robot Framework(Selenium)中编写了以下脚本,以验证下拉列表的内容: Verify all required fields and labels are present Verify a and lists of b for 'ööö' Verify a and lists of b for '${xyz}' (...) Dropdown "{abc}" should cont

只是想知道你们中是否有人知道如何在包含下拉列表的网站上处理特殊字符。我在Robot Framework(Selenium)中编写了以下脚本,以验证下拉列表的内容:

Verify all required fields and labels are present
    Verify a and lists of b for 'ööö'

Verify a and lists of b for '${xyz}'
    (...)
    Dropdown "{abc}" should contain options "${json_blabla["ABC"]["${xyz}"]}"
但是,尝试执行此操作时,我在运行脚本时收到以下错误消息:

Resolving variable '${json_blabla["ABC"]["ööö"]}' failed: KeyError: '\xc3\xb6\xc3\xb6\xc3\xb6'
你知道怎么解决这个问题吗?我确信我用UTF-8编码保存了所有内容,我认为JSON文件也应该可以,所以我怀疑它在我刚才展示的脚本中的某个地方?

找到了: 似乎需要明确告知字符串必须使用Unicode,因此纠正该字符串的一个选项是:

Dropdown "{abc}" should contain options "${json_blabla["ABC"][u"${xyz}"]}"

感谢您的投票&下次再投票