Селен не работает на сервере, а работает локальноJAVA

Программисты JAVA общаются здесь
Anonymous
Селен не работает на сервере, а работает локально

Сообщение Anonymous »

Я успешно использовал Selenium для входа на веб -сайт с использованием Java. Когда я пытаюсь сделать то же самое, это не удается в конструкторе WebDriver. < /P>

Код: Выделить всё

  WebDriver driver = new ChromeDriver(options);

В журналах не так много информации:
Caused by: org.openqa.selenium.WebDriverException: Driver server process died prematurely.
< /code>
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Host info: host: 'images6ea0-fmzg6', ip: '10.36.1.17'
< /code>
I suspect that the issue here is that my local machine has a chrome installation that does not exist in the remote server that is supposed to run this code.
I am using selenium 4.31, and it is supposed to have a SeleniumManager that downloads and uses chrome, but I do not see any of that in the logs. Is there a way to download a chrome driver while the project starts and then have selenium talk to it to run this code? So far I have not seen examples of this.

Подробнее здесь: https://stackoverflow.com/questions/796 ... ng-locally

Вернуться в «JAVA»