diff --git a/tests/behat/behat_catquiz.php b/tests/behat/behat_catquiz.php index 091fddfee..ca3aa7253 100644 --- a/tests/behat/behat_catquiz.php +++ b/tests/behat/behat_catquiz.php @@ -55,10 +55,10 @@ public function i_fill_in_the_field_with_dynamic_identifier($numberofitem, $dyna // Assuming you want to find an editor element related to the competency and fill it with the specified value $fields = $this->getSession()->getPage()->findAll('xpath', $xpathtarget); - $counter = 0; + $counter = 1; foreach ($fields as $field) { if ($field->isVisible()) { - if ($counter = $numberofitem) { + if ($counter == (int) $numberofitem) { // Fill in the form field with the specified value. $field->setValue($value); }