Код: Выделить всё
URL remoteUrl = new URL("http://localhost:4444/wd/hub");
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless", "--disable-gpu", "--no-sandbox", "--disable-dev-shm-usage");
log.info("starting web driver");
WebDriver driver = new RemoteWebDriver(remoteUrl, options);
< /code>
Я также попробовал < /p>
URL remoteUrl = new URL("http://remote-chrome-webdriver.default.svc.cluster.local:4444/wd/hub");
< /code>
и < /p>
URL remoteUrl = new URL("http://remote-chrome-webdriver:4444/wd/hub");
< /code>
И все эти параметры дали ConnectException. < /p>
my yaml определяет контейнер селена, как это: < /p>
initContainers:
- name: wait-for-chrome
image: busybox:latest
imagePullPolicy: IfNotPresent
command: ['sh', '-c', 'until curl -f http://remote-chrome-webdriver:4444/wd/hub/status; do echo "Waiting fro remote-chrome-webdriver..."; sleep 5; done;']
resources:
{{- toYaml .Values.resources | nindent 12 }}
- name: remote-chrome-webdriver
image: xxxxxxxxxx/selenium/standalone-chrome:4.23.1
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 4444
protocol: TCP
restartPolicy: Always
env:
- name: "xxxxx_APPLICATION_CREDENTIALS"
value: {{ .Values.env.xxxxxxxxxxx}}
envFrom:
- secretRef:
name: xxxxxx
volumeMounts:
- name: xxxxxx
readOnly: true
mountPath: "/etc/xxxxx"
resources:
{{- toYaml .Values.resources | nindent 12}}
Подробнее здесь: https://stackoverflow.com/questions/796 ... es-cluster