Skip to content

[Need support]: Healenium: Saving elements does not execute for outside driver #299

@Alek5andr

Description

@Alek5andr

Describe the problem

Hi!

I have a problem with storing elements' selectors into PostgreSQL while running Healenium's services in Docker and Selenium's services locally.

Here is the thing:
I start PostgreSQL, Healenium, Healenium-Proxy and selector-imitator in Docker on local machine. The Docker's configuration file is provided. Then I start downloaded standalone chromedriver (simply put chromedriver) version 134 also locally with the command chromedriver --port=4444 --allowed-ips --verbose. After that I launch WebdriverIO example of "healenium-example-webdriverio" by executing the command npm run wdio. "wdio.conf.js" file contains properties for Healenium-proxy:

    services: [],
    hostname: '192.168.1.222', // local machine IP-address
    port: 8085,
    protocol: 'http',

Test runs fine - successfully. Chromedriver accepts requests and gives responds. Healenium-Proxy initializes a session successfully:

Init Session: {"value":{"capabilities":{"acceptInsecureCerts":true,"browserName":"chrome","browserVersion":"134.0.6998.178","chrome":{"chromedriverVersion":"134.0.6998.165 (fd886e2cb29dd984c13deec032832dee68d8abe3-refs/branch-heads/6998@{#2122})","userDataDir":"C:\\Users\\ALEKSA~1\\AppData\\Local\\Temp\\scoped_dir26372_87912565"},"fedcm:accounts":true,"goog:chromeOptions":{"debuggerAddress":"localhost:63989"},"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platformName":"windows","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"ignore","webSocketUrl":"ws://192.168.1.222:4444/session/77fdd4c6664102728fc34c077e8fa171","webauthn:extension:credBlob":true,"webauthn:extension:largeBlob":true,"webauthn:extension:minPinLength":true,"webauthn:extension:prf":true,"webauthn:virtualAuthenticators":true},"sessionId":"77fdd4c6664102728fc34c077e8fa171"}}

But Heleanium itself does not save elements. It only makes "Get Elements".
Healenium-Proxy just generates an empty result in the end.
That's all. No stored selectors.

HOWEVER
If I stop local chromedriver and create&run another container consisting of "selenium/standalone-chrome:latest":

chrome2in1:
    image: selenium/standalone-chrome:latest
    container_name: standalone-chrome
    shm_size: 2gb
    ports:
    - "4444:4444"
    - "7900:7900"

then Healenium save elements successfully! How? Why? I could not figure it out.
Searching for a help, how does Healenium decides to store elements.

Healenium Web version

None

Healenium Backend version

3.4.7

Selenium version

standalone chromedriver 134

Platform

NodeJS

Properties file

services:

  postgres-db:
    image: postgres:11-alpine
    container_name: postgres-db
    restart: always
    ports:
      - "5432:5432"
    volumes:
      - ./db/sql/init.sql:/docker-entrypoint-initdb.d/init.sql
    environment:
      - POSTGRES_DB=healenium
      - POSTGRES_USER=healenium_user
      - POSTGRES_PASSWORD=YDk2nmNs4s9aCP6K
    networks:
      - healenium

  healenium:
    image: healenium/hlm-backend:3.4.7
    container_name: healenium
    restart: on-failure
    ports:
      - "7878:7878"
    links:
      - postgres-db
    environment:
      - SPRING_POSTGRES_DB=healenium
      - SPRING_POSTGRES_SCHEMA=healenium
      - SPRING_POSTGRES_USER=healenium_user
      - SPRING_POSTGRES_PASSWORD=YDk2nmNs4s9aCP6K
      - SPRING_POSTGRES_DB_HOST=postgres-db
      - KEY_SELECTOR_URL=false
      - COLLECT_METRICS=true
      - FIND_ELEMENTS_AUTO_HEALING=true
      - HLM_LOG_LEVEL=debug
    volumes:
      - ./screenshots/:/screenshots
      - ./logs/:/logs
    networks:
      - healenium

  selector-imitator:
    image: healenium/hlm-selector-imitator:1.4
    container_name: selector-imitator
    restart: on-failure
    ports:
      - "8000:8000"
    networks:
      - healenium

  hlm-proxy:
    image: healenium/hlm-proxy:2.1.5
    container_name: hlm-proxy
    restart: on-failure
    ports:
      - "8085:8085"
    environment:
      - RECOVERY_TRIES=1
      - SCORE_CAP=.6
      - HEAL_ENABLED=true
      - SELENIUM_SERVER_URL=http://host.docker.internal:4444/wd/hub
      - HEALENIUM_SERVER_URL=http://localhost:7878
      - HEALENIUM_SERVICE=http://healenium:7878
      - IMITATE_SERVICE=http://selector-imitator:8000
      - HLM_LOG_LEVEL=debug
    volumes:
      - ./logs/:/logs
    networks:
      - healenium
      


networks:
  healenium:
    name: healenium

Logs appeared during using Healenium

[Get Elements] Response: ConfigSelectorDto(urlForKey=false, pathForKey=false, disableHealingElementDto=[], enableHealingElementsDto=[], findElementsAutoHealing=true)

Additional context

Healenium-Proxy

[Get Elements] Request: (GET) /elements 
[Init Report] Request: (POST) /report/init/77fdd4c6664102728fc34c077e8fa171

PostgreSQL

uid:elements:create_date
77fdd4c6664102728fc34c077e8fa171:{"records":[]}:2025-03-26 14:12:19.681

Metadata

Metadata

Assignees

Labels

help wantedExtra attention is needed

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions