Selenium Operations

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Connecting to Debug VNC Server

Selenium pods come with an embedded VNC server that allows connection from remote VNC clients.

To check whether the VNC server is running, execute ps, you should see:

x11vnc -usepw -forever -shared -rfbport 5900 -display :99.0 -noxrecord

The 5900 port should be exposed by a service similar to:

apiVersion: v1
kind: Service
metadata:
  name: 'selenium-chrome'
spec:
  type: LoadBalancer
  ports:
    - name: 4444-tcp
      port: 4444
      targetPort: 4444
      protocol: TCP
    - name: 5900-tcp
      port: 5900
      protocol: TCP
      targetPort: 5900
  selector:
    function: 'selenium-chrome'
  externalTrafficPolicy: Cluster

If the pod executes on a remote Kubernetes node, available via ssh, tunnel to whatever port is the service exposed to (32614 is just an example):

ssh -N -L 5900:localhost:32614 <kubernetes-node>

Then connect with the VNC client (Applications/VNC Viewer), using "localhost:5900" and "secret" as password.

More details are available here: https://github.com/SeleniumHQ/docker-selenium

Upgrading Chrome and Chrome Driver in Container

Selenium Local Component Startup

For instructions to install Selenium standalone serverJAR, see:

Selenium Standalone Server Installation

To start a standalone server:

https://github.com/ovidiuf/playground/blob/master/selenium/selenium-standalone-server