Home > Back-end >  Selenium Grid in Kubernetes Languade de-DE not working in headless mode
Selenium Grid in Kubernetes Languade de-DE not working in headless mode

Time:07-29

We are trying to move our Selenium Grid to Kubernetes. However, we are unable to set the language. With a local Grid in Standalone Mode the settings are used, but not on the Kubernetes.

We did find two related solutions to this issue, but neither did work on our Kubernetes:

var chromeOptions = new ChromeOptions();
chromeOptions.AddUserProfilePreference("intl.accept_languages", "de-DE"); 
var driver = new RemoteWebDriver(new Uri(seleniumGridHubUrl), chromeOptions.ToCapabilities());
var chromeOptions = new ChromeOptions();
    chromeOptions.AddArguments("--lang=de");
    var driver = new RemoteWebDriver(new Uri(seleniumGridHubUrl), chromeOptions.ToCapabilities());

We are using headless mode. If we do not use headless mode, the language is set. But in this case the resolution is too low. We need hd resolution.

We are also having a problem with a timeout after creating a new session. If the nodes are in use, this may happen with a node waiting. We try to define for this case a larger timeout, but it does not work. Any help on this topic would be appreciated:

 - name: GRID_TIMEOUT
          value: "600"
        - name: GRID_BROWSER_TIMEOUT
          value: "600"
        - name: SE_NODE_SESSION_TIMEOUT
          value: "600"
        - name: SE_SESSION_REQUEST_TIMEOUT
          value: "300"

CodePudding user response:

We have been able to define the resolution for Selenium Grif 4. We had first 'SE_' at the beginning of the property names.

- name: SCREEN_WIDTH
          value: "1920"
- name: SCREEN_HEIGHT
          value: "1080"

CodePudding user response:

Not setting the language may be an issue related to ubuntu images. However, not using headless mode does not bring up this problem. A workaround would be to have yaml files depending on the language for each node. This is the code section:

spec:
      containers:
      - env:
        - name: LANG
          value: de-DE.UTF-8
        - name: LANGUAGE
          value: de_DE

Oner of the both options did help. When not using headless mode this is not an issue.

  • Related