问题
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