public ImportObjectPage chooseFile(File file) { $(By.name("input:inputFile:fileInput")).uploadFile(file); //todo implement return this; }
public PrismForm<T> setFileForUploadAsAttributeValue(String name, File file) { SelenideElement property = findProperty(name); property.$(By.cssSelector("input.form-object-value-binary-file-input")).uploadFile(file); return this; }
/** * Выполняется нажатие на кнопку и подгружается указанный файл * Селектор кнопки должны быть строго на input элемента * Можно указать путь до файла. Например, src/test/resources/example.pdf */ @Когда("^выполнено нажатие на кнопку \"([^\"]*)\" и загружен файл \"([^\"]*)\"$") public void clickOnButtonAndUploadFile(String buttonName, String fileName) { String file = loadValueFromFileOrPropertyOrVariableOrDefault(fileName); File attachmentFile = new File(file); akitaScenario.getCurrentPage().getElement(buttonName).uploadFile(attachmentFile); } }