Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用Play'验证名称包含点(.)的元素;硒标签_Java_Selenium_Playframework - Fatal编程技术网

Java 使用Play'验证名称包含点(.)的元素;硒标签

Java 使用Play'验证名称包含点(.)的元素;硒标签,java,selenium,playframework,Java,Selenium,Playframework,我试图通过使用Play框架的selenium标记编写一个selenium测试来验证页面上的一个元素。我有这样的想法: #{selenium} open('/') verifyElementPresent(//input[@name='foo.bar']) #{selenium} 当我在测试运行程序中查看selenium测试时(http://localhost:9000/@测试)并查看单个测试和要执行的步骤,未显示VerifyElement当前步骤。如果我将该步骤更改为:

我试图通过使用Play框架的selenium标记编写一个selenium测试来验证页面上的一个元素。我有这样的想法:

#{selenium}
    open('/')
    verifyElementPresent(//input[@name='foo.bar'])
#{selenium} 
当我在测试运行程序中查看selenium测试时(http://localhost:9000/@测试)并查看单个测试和要执行的步骤,未显示VerifyElement当前步骤。如果我将该步骤更改为:

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

该步骤如预期的那样出现。因此,名称中的点似乎引起了问题。即使XPath中间有一个点,是否有人知道该如何显示步骤?

看起来好像是硒标签正在搞乱。角色,这里有一个解决方法:

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