使用Play的Selenium标签验证名称中包含点(。)的元素

时间:2011-08-15 06:31:05

标签: java selenium playframework

我正在尝试使用Play Framework的Selenium标签编写selenium测试来验证页面上的元素。我有这样的事情:

#{selenium}
    open('/')
    verifyElementPresent(//input[@name='foo.bar'])
#{selenium} 

当我在测试运行器中查看selenium测试(http:// localhost:9000 / @ tests)并查看单个测试和要执行的步骤时, verifyElementPresent 步骤未显示。如果我将该步骤更改为:

    verifyElementPresent(//input[@name='foo'])

该步骤按预期显示。因此,名称中的点似乎会导致问题。有没有人知道如何让步骤显示,即使xpath中间有一个点?

1 个答案:

答案 0 :(得分:3)

好像硒标签搞砸了。字符,这是一个解决方法:

#{selenium}
    verifyElementPresent(//input[@name="foo.bar"])
#{/selenium}