Skip to content

Commit

Permalink
fix to correctly count and compare elements
Browse files Browse the repository at this point in the history
  • Loading branch information
semteacher committed Jan 24, 2024
1 parent 64db0b5 commit b205b16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/behat/behat_catquiz.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit b205b16

Please sign in to comment.