gpt4 book ai didi

grails - 在 grails geb 中通过数字 id 进行选择

转载 作者:行者123 更新时间:2023-12-02 14:25:49 25 4
gpt4 key购买 nike

使用 selenium 的 chrome 驱动程序,我试图通过它的 id 从我的页面中选择一个元素,它是数字的(即 1000)。

这失败了,给出:

org.openqa.selenium.InvalidElementStateException: findElements execution failed;
SYNTAX_ERR: DOM Exception 12 (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 13 milliseconds
Build info: version: '2.2.1', revision: '16551', time: '2012-04-11 21:42:35'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '3.2.0-33-generic', java.version: '1.7.0_09'
Driver info: driver.version: RemoteWebDriver

但是,如果我将 id 更改为不完全由数字组成的字符串(即 m1000),则选择有效。

知道为什么会这样吗?

最佳答案

好像是因为ID tokens must begin with a letter ([A-Za-z]) ,见 http://w3.org/TR/html401/types.html#type-name

关于grails - 在 grails geb 中通过数字 id 进行选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13523881/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com