开发者

Selenium click command target attribute doesn't work using xpath

开发者 https://www.devze.com 2023-03-18 15:27 出处:网络
Trying to get #1 to work in Selenium IDE.#2 works fine.I\'m trying to check the checkbox (input tag).When I store the value of this xpath id, it finds the correct id.But the click command can\'t inter

Trying to get #1 to work in Selenium IDE. #2 works fine. I'm trying to check the checkbox (input tag). When I store the value of this xpath id, it finds the correct id. But the click command can't interpret the result of 开发者_JAVA技巧the xpath expression as the id for some reason.

HTML:

<input type="checkbox" id="ChkObject813844">

#1:

command: click

target: xpath=//input[contains(@id,'ChkObject')]/@id <=== isn't working!

value:

#2:

command: click

target: ChkObject813844 <=== is working!

value:


Had to add a command prior to #1 to store the value of the id first.

command: storeValue
target: xpath=//input[contains(@id,'ChkObject')]/@id
value: var_id

command: click
target: ${var_id}
value:

0

精彩评论

暂无评论...
验证码 换一张
取 消