Call to undefined method AcceptanceTester::getModule

自古美人都是妖i 提交于 2019-12-12 03:37:51

问题


Here is my code -

<?php
class ClassiDescCest{
        public function desc(AcceptanceTester $I){
            $classifications = $this->getModule('WebDriver')->_findElements('/html/body/div[1]/div/section/div/div/div/div/div[2]/div[2]/div[1]/div/div/span/a/span');
            echo $classifications.size();

        }
}

Here is the error that I am getting - Error for undefined method


回答1:


$this->getModule() can't be used in the Cest file,

_findElements is a hidden method and can only be used in helpers as documented in http://codeception.com/docs/06-ModulesAndHelpers

Also check if grabMultiple method does what you need.



来源:https://stackoverflow.com/questions/38763010/call-to-undefined-method-acceptancetestergetmodule

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!