【问题标题】:phpunit selenium select with assign valuephpunit selenium 选择分配值
【发布时间】:2014-08-18 03:22:39
【问题描述】:

当我分配值时它不起作用

var $title = "name=order[contact][title]" ;
var $title_val = "label=Mr" ;

public function fillCustomerInfo() {
        $this->select($this->title, $title_val);        
        return $this;
}

正常工作

public function fillCustomerInfo() {
    $this->select("name=order[contact][title]","label=Mr");         
    return $this;

}

那么,如何在函数中赋值呢?

提前致谢。

【问题讨论】:

    标签: selenium phpunit


    【解决方案1】:

    你可以这样使用

    var $title_val = "label=Mr" ;

    如果你调用你需要使用的变量 $this->title_val;

    所以,正确的代码是

    var $title = "name=order[contact][title]" ;
    var $title_val = "label=Mr" ;
    
    public function fillCustomerInfo() {
            $this->select($this->title, $this->title_val);        
            return $this;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-04-25
      • 2013-05-14
      • 1970-01-01
      • 2014-04-10
      • 2012-07-23
      • 2013-12-19
      • 1970-01-01
      • 2014-08-20
      相关资源
      最近更新 更多