【问题标题】:Codeception Acceptance Test How to find css Pseudo classes elementCodeception验收测试如何找到css伪类元素
【发布时间】:2017-08-04 03:49:21
【问题描述】:

我的测试 Html 像这样:

<a  class="waves-effect waves-light btn red ">Delete</a>

删除

我想使用 CSS 选择器:

.red:not(.disabled):first

但我写在 Codeception Acceptance 测试用例中

$I->click(['css' =>'.red:not(.disabled):first']);

它会抛出一个错误:

Strict locator is malformed: css => .red:not('.disabled):first

Codeception如何获取这个元素?

【问题讨论】:

  • 也许还有另一种组成选择器的方式,如果可能的话,请添加元素的html sn-p,同时启用和禁用的情况。

标签: codeception


【解决方案1】:

更改为 xpath 选择器 '(//*[contains(@class,"red") and not(@disabled)])[1]' 可以帮助您。

【讨论】:

    猜你喜欢
    • 2016-11-03
    • 1970-01-01
    • 1970-01-01
    • 2018-12-27
    • 2014-02-01
    • 2018-10-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多