использую стандартный пример с GitHub - selenide/selenide-selenoid: Selenoid plugin for Selenide для скачивания файла без ссылки
изменил в коде следующее
class SelenoidExtension implements BeforeAllCallback {
@Override
public void beforeAll(ExtensionContext context) {
Configuration.remote = "http://localhost:4444/wd/hub";
Configuration.reportsFolder = "target/surefire-reports";
Configuration.downloadsFolder = "target/downloads";
}
}
public class FileDownloadTest {
@BeforeEach
void setUp() {
Configuration.fileDownload = FileDownloadMode.FOLDER;
}
@Test
void download() throws IOException {
open("https://fastest.fish/test-files");
$("#byteCount").clear();
$("#byteCount").setValue("1");
$("#multiplier").selectOption("KiB");
File file = $("div.form-row button").download();
assertThat(file.getName()).isEqualTo("1KiB.bin");
}
}
локально файл скачивается успешно, а с параметром Configuration.remote = “http://localhost:4444/wd/hub” - падает с ошибкой
[main] INFO com.codeborne.selenide.impl.WebDriverThreadLocalContainer - No webdriver is bound to current thread: 1 - let's create a new webdriver
[main] INFO com.codeborne.selenide.webdriver.WebDriverFactory - BrowserName=chrome Version=108.0.5359.94 Platform=LINUX
[main] INFO com.codeborne.selenide.webdriver.WebDriverFactory - Selenide v. 6.11.1
[main] INFO com.codeborne.selenide.webdriver.WebDriverFactory - Selenium WebDriver v. 4.7.2 build revision: 4d4020c3b7
[main] INFO com.codeborne.selenide.drivercommands.CreateDriverCommand - Created webdriver in thread 1: RemoteWebDriver -> RemoteWebDriver: chrome on LINUX (48b90b27e41773ed7adf97fbe535c446)
[main] INFO com.codeborne.selenide.drivercommands.DisposablesRegistry - Register WebDriverInstance[config=StaticConfig,webDriver=RemoteWebDriver: chrome on LINUX (48b90b27e41773ed7adf97fbe535c446),proxy=null,downloadsFolder=null] in 1 [size=1]
[main] INFO com.codeborne.selenide.drivercommands.DisposablesRegistry - Add shutdown hook in 1 [size=1]
[main] INFO com.codeborne.selenide.impl.Plugins - Using implementation of com.codeborne.selenide.impl.DownloadFileToFolder: org.selenide.selenoid.DownloadFileInSelenoid
[main] INFO com.codeborne.selenide.impl.FileHelper - Creating folder: C:\projects\selenoid-sample\target\downloads\6f71acea-1841-4b81-a781-2322501efeaa
org.opentest4j.AssertionFailedError:
expected: "1KiB.bin"
but was: "Unconfirmed 444593.crdownload"
Expected :"1KiB.bin"
Actual :"Unconfirmed 444593.crdownload"
Вопрос: Как скачать файл без ссылки в Selenide-Selenoid?
Использую Windows10
скачал и установил Selenoid