Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/236.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
在localhost或Jenkins上使用php selenium的不同行为_Php_Selenium_Jenkins - Fatal编程技术网

在localhost或Jenkins上使用php selenium的不同行为

在localhost或Jenkins上使用php selenium的不同行为,php,selenium,jenkins,Php,Selenium,Jenkins,当我在本地机器上使用php Selenium并将其推给Jenkins时,我遇到了使用php Selenium的奇怪情况 所以我有这个函数 public function tableContent() { $data = array(); $rows = TableBase::getAllTableRowsById($this->getWebdriver(), self::TABLE); foreach ($rows as $row) { //

当我在本地机器上使用php Selenium并将其推给Jenkins时,我遇到了使用php Selenium的奇怪情况

所以我有这个函数

public function tableContent()
{    
    $data = array();
    $rows = TableBase::getAllTableRowsById($this->getWebdriver(), self::TABLE);
    foreach ($rows as $row) {
        //The problematic part
        $row->getLocationOnScreenOnceScrolledIntoView();
        array_push($data, $this->getRowCellValuesByHeaderName($row));
    }

    return $data;
}
该函数遍历整个表,并为每一行收集数据。然后返回数据数组的数组。问题是,一旦我在本地计算机上运行此代码,GetLocationScreenOnScrolledToView工作正常,表滚动器就会移动。但是,当我将代码提交给jenkins,然后在远程机器上观看测试时,GetLocationsCreenOnScreenScrolledinToView方法不起作用。滚动条没有移动。所以,若视图并没有滚动,所有的数据都不会被收集,测试就会失败。 那么Jenkins上的GetLocationScreenOnScreenScrolledToView有什么限制吗?为什么localhost测试可以工作,但Jenkins上没有相同的测试


如果您需要任何其他信息,请让我知道,我会提供。谢谢

看起来是渲染问题。Jenkins是在虚拟机上运行的,所以这就是为什么代码“get”丢失的原因,看起来好像是渲染问题。Jenkins是在虚拟机上运行的,所以这就是代码“get”丢失的原因