开发者

Select selenium element by name with parantheses?

I have the following input element:

<input name='selected(1234)' type="checkbox" />

When I record, I get this:

Command: click
Target: selected(1234)

This doesn't find the element, and ne开发者_开发知识库ither does

Target: name=selected(1234)

My assumption is that the parentheses are somehow messing with the lookup. What's the proper way to do this?


Try using an XPath:

Command: click
Target: xpath=//input[@type='checkbox'][@name='selected(1234)']

However, if you're trying to check (as in mark not verify) the checkbox, you really should use:

Command: check
Target: xpath=//input[@type='checkbox'][@name='selected(1234)']


This could be a timing issue. If you record a test in selenium-IDE, it won't give you the waitForPageLoad commands you need when you convert the test to java.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜