开发者

selenium is able to find but unable to click on an unicode character

I am having trouble getting selenium RC to click on a button. There is a button on a page that has the character "pi" on it and I am trying to click on it. The html code looks something like this

<div id="abc">
<a class="my keys one" keystring="Pi" keyvalue="π"
π
</a>
</div>

This is what I have done so far - selenium.click("//div[@id='abc']/a[1]");

This returns an OK but on the page, when I see visually, the button is not clicked (on click, the page has to do something).

I have tried other stuff like getting the Attribute and making it click on it, but doesnt work- selenium.click(selenium.getAttribute("//div[@id='abc']/a[1]@keystring"));

I have even tried converting the above selenium.getAttribute to a unicode value and then clicking on it. That does not work too.

Also, I added a line to check if at least selenium thinks the character pi is present on the page. I used the unicode of开发者_如何学编程 pi- selenium.isElementPresent("\u03c0"); On eclipse, when I run it, this shows up- isElementPresent[?, ] on session... and returns a false.

I am stumped. Can anyone please point to me what is it that I am doing wrong?


i thin this may help you.

selenium.click("//a[@class='my keys one']");
or
selenium.click("xpath=//a[@class='my keys one'"]");

if it is not workin use css path.


I a similar issue. My button has a "black down-pointing triangle" on it and none of the other attributes are unique (the "class", "id", and "role" are reused over and over on the same page). The only unique thing I have is a "value" that is a symbol.

value="▼ "

I, too, would like to know if there is a way to click on this button.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜