机器人测试用硒,Xpath中如果有特殊字符,Xpath找不到元素。

问题描述 投票:0回答:1

当我们在法语中运行机器人测试案例时得到以下错误,但在英语中运行同样的测试案例。

InvalidSelectorException: Message: invalid selector: Unable to locate an element with the xpath expression //span[contains(@class, 'v-button-caption')and text()=Options de sélection] because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//span[contains(@class, 'v-button-caption')and text()=Options de sélection]' is not a valid XPath expression.

运行windows机器,改变了EOL(UTF-8,基于unix)也为文件,但不能工作。

python automated-tests robotframework
1个回答
1
投票

这工作后改变和text()='Options de sélection'括在''(引号)

© www.soinside.com 2019 - 2024. All rights reserved.