【问题标题】:How to test if selector exists in CasperJS?如何测试 CasperJS 中是否存在选择器?
【发布时间】:2015-11-18 03:19:36
【问题描述】:

我知道我可以使用:

casper.test.assertExists(#selector);

但我想实际存储它是否存在于布尔变量中。

即像这样:

var exists = SelectorExists(#selector);

【问题讨论】:

    标签: javascript casperjs


    【解决方案1】:

    我刚刚发现:

    if(!casper.exists('#selector')){
       #selector doesn't exist
    }
    

    【讨论】:

      猜你喜欢
      • 2014-10-20
      • 1970-01-01
      • 2019-01-04
      • 2023-03-23
      • 2020-02-28
      • 1970-01-01
      • 2018-11-21
      • 1970-01-01
      • 2014-02-01
      相关资源
      最近更新 更多