healenium / healenium-web

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

Failed to make response #113

Closed Prasan02 closed 3 years ago

Prasan02 commented 3 years ago

Hi, I am trying to implement Healenium, but i am keep getting this message we i try to heal a locator even though when the backend is up and running

Connected to the target VM, address: '127.0.0.1:51026', transport: 'socket' [main] INFO io.github.bonigarcia.wdm.WebDriverManager - Using chromedriver 91.0.4472.101 (resolved driver for Chrome 91) [main] INFO io.github.bonigarcia.wdm.WebDriverManager - Exporting webdriver.chrome.driver as C:\Users\.cache\selenium\chromedriver\win32\91.0.4472.101\chromedriver.exe Starting ChromeDriver 91.0.4472.101 (af52a90bf87030dd1523486a1cd3ae25c5d76c9b-refs/branch-heads/4472@{#1462}) on port 23929 Only local connections are allowed. Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. ChromeDriver was started successfully. Jun 29, 2021 9:39:53 AM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: W3C [main] WARN com.epam.healenium.handlers.proxy.BaseHandler - Failed to find an element using locator By.linkText: Gmail Reason: no such element: Unable to locate element: {"method":"link text","selector":"Gmail"} (Session info: chrome=91.0.4472.114) For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/no_such_element.html Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'DT001442', ip: '10.62.65.110', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_291' Driver info: org.openqa.selenium.chrome.ChromeDriver Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 91.0.4472.114, chrome: {chromedriverVersion: 91.0.4472.101 (af52a90bf870..., userDataDir: C:\Users\\AppData\Lo...}, goog:chromeOptions: {debuggerAddress: localhost:59310}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true} Session ID: 3ff69f49f47b295ce4cb15263f9de6a9 Element info: {Using=link text, value=Gmail} Trying to heal... [main] WARN com.epam.healenium.client.RestClient - Failed to make response java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:7878 at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:247) at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:165) at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:257) at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135) at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114) at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200) at okhttp3.RealCall.execute(RealCall.java:77) at com.epam.healenium.client.RestClient.getLastValidPath(RestClient.java:151) at com.epam.healenium.SelfHealingEngine.lambda$getLastValidPaths$7(SelfHealingEngine.java:285) at java.util.Optional.flatMap(Optional.java:241) at com.epam.healenium.SelfHealingEngine.getLastValidPaths(SelfHealingEngine.java:285) at com.epam.healenium.SelfHealingEngine.findNewLocations(SelfHealingEngine.java:197) at com.epam.healenium.service.impl.HealingServiceImpl.healLocators(HealingServiceImpl.java:94) at com.epam.healenium.service.impl.HealingServiceImpl.heal(HealingServiceImpl.java:53) at com.epam.healenium.handlers.proxy.BaseHandler.lookUp(BaseHandler.java:88) at com.epam.healenium.handlers.proxy.BaseHandler.findElement(BaseHandler.java:53) at com.epam.healenium.handlers.proxy.SelfHealingProxyInvocationHandler.invoke(SelfHealingProxyInvocationHandler.java:39) at com.sun.proxy.$Proxy0.findElement(Unknown Source) at com.healing.test.healingTest.main(healingTest.java:20) Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:81) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:476) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:218) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:200) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:162) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:394) at java.net.Socket.connect(Socket.java:606) at okhttp3.internal.platform.Platform.connectSocket(Platform.java:129) at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:245) ... 29 more [main] WARN com.epam.healenium.service.impl.HealingServiceImpl - New element locators have not been found Exception in thread "main" org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"link text","selector":"Gmail"} (Session info: chrome=91.0.4472.114) For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/no_such_element.html Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'DT001442', ip: '10.62.65.110', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_291' Driver info: org.openqa.selenium.chrome.ChromeDriver Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 91.0.4472.114, chrome: {chromedriverVersion: 91.0.4472.101 (af52a90bf870..., userDataDir: C:\Users\\AppData\Lo...}, goog:chromeOptions: {debuggerAddress: localhost:59310}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true} Session ID: 3ff69f49f47b295ce4cb15263f9de6a9 Element info: {Using=link text, value=Gmail} at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:323) at org.openqa.selenium.remote.RemoteWebDriver.findElementByLinkText(RemoteWebDriver.java:380) at org.openqa.selenium.By$ByLinkText.findElement(By.java:220) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:315) at com.epam.healenium.handlers.proxy.BaseHandler.lookUp(BaseHandler.java:82) at com.epam.healenium.handlers.proxy.BaseHandler.findElement(BaseHandler.java:53) at com.epam.healenium.handlers.proxy.SelfHealingProxyInvocationHandler.invoke(SelfHealingProxyInvocationHandler.java:39) at com.sun.proxy.$Proxy0.findElement(Unknown Source) at com.healing.test.healingTest.main(healingTest.java:20) Disconnected from the target VM, address: '127.0.0.1:51026', transport: 'socket'

Process finished with exit code 1

Docker Status

C:\Users\>docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES df7442687672 66784d57b1b2 "java -Djava.securit…" 20 minutes ago Restarting (1) 32 seconds ago db_healenium_1 c36c09bdfd48 283664b901ee "docker-entrypoint.s…" 20 minutes ago Up 20 minutes 0.0.0.0:5433->5432/tcp, :::5433->5432/tcp db_db_1

GannaChernyshova commented 3 years ago

Hi @Prasan02 please take a look at this issue https://github.com/healenium/healenium-web/issues/107

Prasan02 commented 3 years ago

Hi Anna, thanks!

In my case I have set the PORT correctly and property file also. However still its not working. Infact Backend restarting immediately after running .yaml file.

Kindly let me know where else to check PORT related issues.

I tried :

Still its the same issue

Prasan02 commented 3 years ago

Issue resolved its basically folder structure and Naming conventions.

Vishnupk1993 commented 2 years ago

@Prasan02 Tried the same but still i'm facing the below issue. Disconnected from the target VM, address: '127.0.0.1:54943', transport: 'socket' Process finished with exit code 1.

Installed docker and did all the configuration. Is there any way to check whether the elements are getting saved in docker ?

ElenaStepuro commented 2 years ago

Hello @Prasan02 ! Could you please provide information below:

priyanka748 commented 2 years ago

I am getting this issue com.epam.healenium.client.HealingClient makePost WARNING: Failed to perform POST request. Reason: unexpected end of stream http://192.176.120.27:9090/.Null

ElenaStepuro commented 2 years ago

I am getting this issue com.epam.healenium.client.HealingClient makePost WARNING: Failed to perform POST request. Reason: unexpected end of stream http://192.176.120.27:9090/.Null

Hello @priyanka748 .Could you please provide more information?

priyanka748 commented 2 years ago

YES.. @ElenaStepuro WEB IS chrome and I am running it on eclipse

nd healenium.properties..

basePath = sha/healenium reportPath = build/reports screenshotPath = build//screenshots/ recovery-tries = 1 score-cap = 0.5 heal-enabled = true serverHost = 192.168.100.45 serverPort = 7878 imitatePort = 8000

priyanka748 commented 2 years ago

I am trying to implement through eclipse not with docker.. a maven project

ElenaStepuro commented 2 years ago

Sorry for misunderstanding, but I mean healenium-web and healenium-back verions)

What do you mean when saying about eclipse implementation? Possibly I didn't understand you correctly but to use healenium you must start docker containers. It doesn't matter if you run them using your ide or docker desktop.

priyanka748 commented 2 years ago

ohh!! Okay

Yohitha commented 2 years ago

@priyanka748 - is this issue resolved? unable to connect with serverPort = 7878

priyanka748 commented 2 years ago

@Yohitha u can see this issue https://github.com/healenium/healenium-web/issues/170#issuecomment-1025860084

chethanmp-agi commented 2 years ago

Issue resolved its basically folder structure and Naming conventions.

Can you please send me solution same issue like below at com.epam.healenium.handlers.proxy.SelfHealingProxyInvocationHandler.invoke(SelfHealingProxyInvocationHandler.java:39)

mpchethan commented 2 years ago

Issue resolved its basically folder structure and Naming conventions.

can you please send me folder structure and Naming conventions... im getting same issue

ElenaStepuro commented 2 years ago

Hello @mpchethan Folder structure and naming you can find in documentation: https://healenium.io/docs