1
votes

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
$classifications.size(); looks like Javascript code, PHP way is count($classifications); - Naktibalda

1 Answers

2
votes

$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.