diff --git a/src/Behat/Context/MediaContext.php b/src/Behat/Context/MediaContext.php index 7a37d72..323e381 100755 --- a/src/Behat/Context/MediaContext.php +++ b/src/Behat/Context/MediaContext.php @@ -77,7 +77,7 @@ public function iUploadMediaWithNameToField($media_title, $field, $widget) { if ($widget == 'media_library') { $this->uiContext->iClickOnTheElementWithXpath("//input[contains(@id, 'edit-" . $field . "-open-button')]"); $this->waitingContext->iWaitForAjaxToFinish(30); - $xpath = "//*[@id='drupal-modal']//label[contains(text(),'". $media_title ."')]/following-sibling::input"; + $xpath = "//div[contains(@class, 'views-field-media-library-select-form')]//div[contains(@class, 'form-type--checkbox')]/label[contains(text(),'". $media_title ."')]/following-sibling::input"; $this->iSelectMedia($widget, $xpath); } }