diff --git a/theme/classic/tests/behat/behat_theme_classic_behat_repository_upload.php b/theme/classic/tests/behat/behat_theme_classic_behat_repository_upload.php index 369b91e390919..365548f9454ff 100644 --- a/theme/classic/tests/behat/behat_theme_classic_behat_repository_upload.php +++ b/theme/classic/tests/behat/behat_theme_classic_behat_repository_upload.php @@ -59,11 +59,11 @@ protected function get_filepicker_node($filepickerelement) { $exception ); } else { - // Gets the ffilemanager node specified by the locator which contains the filepicker container. + // Gets the filemanager node specified by the locator which contains the filepicker container. $filepickerelement = behat_context_helper::escape($filepickerelement); $filepickercontainer = $this->find( 'xpath', - "//input[./@id = //label[normalize-space(.)=$filepickerelement]/@for]" . + "//input[./@id = substring-before(//p[normalize-space(.)=$filepickerelement]/@id, '_label')]" . "//ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' felement ')]", $exception );