healenium / healenium-web

Self-healing library for Selenium Web-based tests
Apache License 2.0
169 stars 40 forks source link

[Need support]: Failed to make response of 'selectorsRequest' request.java.net.SocketTimeoutException: timeout #215

Closed haribabusunkari closed 1 year ago

haribabusunkari commented 1 year ago

Describe the problem

Not healing. Inserting data to selectors table. Failed to make response of 'selectorsRequest' request.java.net.SocketTimeoutException: timeout

Healenium Web version

3.3.0

Healenium Backend version

3.2.5

Selenium version

4.3.0

Platform

java version 1.8

Properties file

recovery-tries = 1 score-cap = .5 heal-enabled = true hlm.server.url = http://10.119.12.186:7878 hlm.imitator.url = **http://10.119.12.186:8000

Logs appeared during using Healenium

Eclipse log
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
2022-11-29 19:20:22,910 - Failed to make response of 'selectorsRequest' request.java.net.SocketTimeoutException: timeout
2022-11-29 19:20:54,327 - Failed to make response of 'selectorsRequest' request.java.net.SocketTimeoutException: timeout
2022-11-29 19:21:25,738 - Failed to make response of 'selectorsRequest' request.java.net.SocketTimeoutException: timeout

Hlm-backend:
2022-11-29 16:04:54.328  INFO 2300 - [       main] com.epam.healenium.Application   : Starting Application using Java 1.8.0_181 on 10-119-12-186 with PID 2300 (C:\Users\madalbh\Downloads\healenium-backend-3.2.5.jar started by madalbh in C:\Users\madalbh\Downloads)
2022-11-29 16:04:54.331  INFO 2300 - [       main] com.epam.healenium.Application   : No active profile set, falling back to 1 default profile: "default"
2022-11-29 16:04:55.380  INFO 2300 - [       main] .RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2022-11-29 16:04:55.595  INFO 2300 - [       main] .RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 205 ms. Found 4 JPA repository interfaces.
2022-11-29 16:04:56.324  INFO 2300 - [       main] o.s.b.w.e.t.TomcatWebServer      : Tomcat initialized with port(s): 7878 (http)
2022-11-29 16:04:56.337  INFO 2300 - [       main] o.a.c.core.StandardService       : Starting service [Tomcat]
2022-11-29 16:04:56.337  INFO 2300 - [       main] o.a.c.core.StandardEngine        : Starting Servlet engine: [Apache Tomcat/9.0.64]
2022-11-29 16:04:56.464  INFO 2300 - [       main] o.a.c.c.C.[.[localhost].[/]      : Initializing Spring embedded WebApplicationContext
2022-11-29 16:04:56.464  INFO 2300 - [       main] rvletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2079 ms
2022-11-29 16:04:56.766  INFO 2300 - [       main] c.z.hikari.HikariDataSource      : HikariPool-1 - Starting...
2022-11-29 16:04:57.012  INFO 2300 - [       main] c.z.hikari.HikariDataSource      : HikariPool-1 - Start completed.
2022-11-29 16:04:57.159  INFO 2300 - [       main] liquibase.database               : Set default schema name to healenium
2022-11-29 16:04:57.241  INFO 2300 - [       main] liquibase.lockservice            : Successfully acquired change log lock
2022-11-29 16:04:57.813  INFO 2300 - [       main] liquibase.changelog              : Reading from healenium.databasechangelog
2022-11-29 16:04:57.861  INFO 2300 - [       main] liquibase.lockservice            : Successfully released change log lock
2022-11-29 16:04:58.021  INFO 2300 - [       main] o.h.j.internal.util.LogHelper    : HHH000204: Processing PersistenceUnitInfo [name: default]
2022-11-29 16:04:58.155  INFO 2300 - [       main] org.hibernate.Version            : HHH000412: Hibernate ORM core version 5.6.9.Final
2022-11-29 16:04:58.372  INFO 2300 - [       main] o.h.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2022-11-29 16:04:58.499  INFO 2300 - [       main] org.hibernate.dialect.Dialect    : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQLDialect
2022-11-29 16:04:59.330  WARN 2300 - [       main] o.h.m.internal.MetadataContext   : HHH015011: Unable to locate static metamodel field : com.epam.healenium.model.domain.Selector_#nodePathWrapper; this may or may not indicate a problem with the static metamodel
2022-11-29 16:04:59.339  INFO 2300 - [       main] h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2022-11-29 16:04:59.378  INFO 2300 - [       main] ontainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2022-11-29 16:05:00.523  INFO 2300 - [       main] .s.b.a.e.w.EndpointLinksResolver : Exposing 1 endpoint(s) beneath base path '/actuator'
2022-11-29 16:05:00.570  INFO 2300 - [       main] o.s.b.w.e.t.TomcatWebServer      : Tomcat started on port(s): 7878 (http) with context path ''
2022-11-29 16:05:00.589  INFO 2300 - [       main] com.epam.healenium.Application   : Started Application in 7.307 seconds (JVM running for 8.07)
2022-11-29 16:11:25.685  INFO 2300 - [7878-exec-1] o.a.c.c.C.[.[localhost].[/]      : Initializing Spring DispatcherServlet 'dispatcherServlet'
2022-11-29 16:11:25.685  INFO 2300 - [7878-exec-1] o.s.w.s.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2022-11-29 16:11:25.687  INFO 2300 - [7878-exec-1] o.s.w.s.DispatcherServlet        : Completed initialization in 1 ms
2022-11-29 16:33:14.858  INFO 2300 - [7878-exec-5] c.e.h.c.HealingController        : Save locator: By.xpath(//input[@id='login'])
2022-11-29 16:33:16.523  INFO 2300 - [7878-exec-6] c.e.h.c.HealingController        : Save locator: By.xpath(//input[@id='passwd'])
2022-11-29 16:33:18.179  INFO 2300 - [7878-exec-7] c.e.h.c.HealingController        : Save locator: By.xpath(//a[text()='Log On'])
2022-11-29 16:35:05.169  INFO 2300 - [7878-exec-2] c.e.h.c.HealingController        : Save locator: By.xpath(//input[@id='login'])
2022-11-29 16:35:06.830  INFO 2300 - [7878-exec-3] c.e.h.c.HealingController        : Save locator: By.xpath(//input[@id='passwd'])
2022-11-29 16:35:08.517  INFO 2300 - [7878-exec-4] c.e.h.c.HealingController        : Save locator: By.xpath(//a[text()='Log On'])

Imitator logs:

INFO:     Started server process [5280]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)

Additional context

No response

raghunadh10 commented 1 year ago

Hi @haribabusunkari . Try restarting the backend server and imitator . i hope that works . it worked for me .

haribabusunkari commented 1 year ago

@raghunadh10 Now getting below error Trying to heal... java.lang.NoSuchMethodError: org.jsoup.nodes.Document.root()Lorg/jsoup/nodes/Node;

2022-12-01 14:32:13,626 - Failed to find an element using locator By.xpath: //input[@id='passwd'] Reason: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@id='passwd']"} (Session info: chrome=107.0.5304.122) For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/no_such_element.html Build info: version: 'unknown', revision: 'unknown', time: 'unknown' System info: host: 'VIN0020ALKKWBNV', ip: '192.168.29.28', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_242' Driver info: org.openqa.selenium.remote.RemoteWebDriver Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 107.0.5304.122, chrome: {chromedriverVersion: 107.0.5304.62 (1eec40d3a576..., userDataDir: C:\Users\madalbh\AppData\Lo...}, goog:chromeOptions: {debuggerAddress: localhost:54374}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(manual, http=hydproxy..., se:bidiEnabled: false, se:cdp: ws://10.119.12.186:4444/ses..., se:cdpVersion: 107.0.5304.122, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true} Session ID: a66241f0e7f886155ade82800902388a *** Element info: {Using=xpath, value=//input[@id='passwd']} Trying to heal... java.lang.NoSuchMethodError: org.jsoup.nodes.Document.root()Lorg/jsoup/nodes/Node;

raghunadh10 commented 1 year ago

Hi @haribabusunkari . This issue can occur when the full clean run is not done during the first time . healenium expects a clean full succesful run to store all the locators in the backend (database) . Ensure this once . if the above issue still persists , make sure the page is loading properly ,sometimes healenium tries to find the element before the page gets loaded . so give some wait time in the scripts wherever it is necessary . Also please ensure whats happening at the issue point by using debugger mode .

haribabusunkari commented 1 year ago

working fine after adding jsoup jar file to build path instead of maven repo