healenium / healenium-web

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

when i run my script iam getting error as com.epam.healenium.handlers.proxy.BaseHandler - Failed to find an element using locator By.xpath #163

Closed MaheshRamchandra closed 2 years ago

MaheshRamchandra commented 2 years ago

Describe the problem

Hi @GannaChernyshova @LittleDecorator @DzmitryHumianiuk @KozhevnikovSergey @OleksiiYevsovych

Hope you are all good !!

[main] WARN com.epam.healenium.handlers.proxy.BaseHandler - Failed to find an element using locator By.xpath: //button[@ng-show='clock']//span[contains(text(),'Clock ')] Reason: no such element: Unable to locate element: {"method":"xpath","selector":"//button[@ng-show='clock']//span[contains(text(),'Clock ')]"} (Session info: chrome=96.0.4664.93) 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: 'MAHESHLAPTOP', ip: '192.168.0.100', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '15.0.1' Driver info: org.openqa.selenium.chrome.ChromeDriver Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 96.0.4664.93, chrome: {chromedriverVersion: 96.0.4664.45 (76e4c1bb2ab46..., userDataDir: C:\Users\IGS0258\AppData\Lo...}, goog:chromeOptions: {debuggerAddress: localhost:54709}, 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:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true} Session ID: 6d1f6e265b3a3e09bab5e1102f99f301 Element info: {Using=xpath, value=//button[@ng-show='clock']//span[contains(text(),'Clock ')]} Trying to heal... [main] WARN com.epam.healenium.service.impl.HealingServiceImpl - New element locator have not been found [ERROR] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 79.683 s <<< FAILURE! - in com.qandleTestScripts.QandleTest [ERROR] clockIn(com.qandleTestScripts.QandleTest) Time elapsed: 28.92 s <<< FAILURE! org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"//button[@ng-show='clock']//span[contains(text(),'Clock ')]"} (Session info: chrome=96.0.4664.93) 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: 'MAHESHLAPTOP', ip: '192.168.0.100', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '15.0.1' Driver info: org.openqa.selenium.chrome.ChromeDriver Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 96.0.4664.93, chrome: {chromedriverVersion: 96.0.4664.45 (76e4c1bb2ab46..., userDataDir: C:\Users\IGS0258\AppData\Lo...}, goog:chromeOptions: {debuggerAddress: localhost:54709}, 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:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true} Session ID: 6d1f6e265b3a3e09bab5e1102f99f301 Element info: {Using=xpath, value=//button[@ng-show='clock']//span[contains(text(),'Clock ')]} at com.qandleTestScripts.QandleTest.clockIn(QandleTest.java:31)

[INFO] [INFO] Results: [INFO] [ERROR] Failures: [ERROR] QandleTest.clockIn:31 » NoSuchElement no such element: Unable to locate elemen... [INFO] [ERROR] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:27 min [INFO] Finished at: 2021-12-11T11:48:19+05:30 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project qandle: There are test failures. [ERROR] [ERROR] Please refer to C:\Wokspace_iOS_Hipi\qandle\target\surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException PS C:\Wokspace_iOS_Hipi\qandle> docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 17915cf31237 healenium/hlm-backend:3.1.5 "java -Djava.securit…" 41 minutes ago Up 41 minutes 0.0.0.0:7878->7878/tcp qandle_healenium_1 1584be9b131c postgres:11-alpine "docker-entrypoint.s…" 41 minutes ago Up 41 minutes 0.0.0.0:5432->5432/tcp qandle_db_1

Healenium Web version

3.1.6

Healenium Backend version

healenium/hlm-backend:3.1.5

Selenium version

3.141.59

Platform

maven project(java)----in Eclipse

Logs appeared during using Healenium

Session ID: 6d1f6e265b3a3e09bab5e1102f99f301
*** Element info: {Using=xpath, value=//button[@ng-show='clock']//span[contains(text(),'Clock ')]}
Trying to heal...
[main] WARN com.epam.healenium.service.impl.HealingServiceImpl - New element locator have not been found
[ERROR] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 79.683 s <<< FAILURE! - in com.qandleTestScripts.QandleTest
[ERROR] clockIn(com.qandleTestScripts.QandleTest)  Time elapsed: 28.92 s  <<< FAILURE!
org.openqa.selenium.NoSuchElementException:
no such element: Unable to locate element: {"method":"xpath","selector":"//button[@ng-show='clock']//span[contains(text(),'Clock ')]"}
  (Session info: chrome=96.0.4664.93)
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: 'MAHESHLAPTOP', ip: '192.168.0.100', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '15.0.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 96.0.4664.93, chrome: {chromedriverVersion: 96.0.4664.45 (76e4c1bb2ab46..., userDataDir: C:\Users\IGS0258\AppData\Lo...}, goog:chromeOptions: {debuggerAddress: localhost:54709}, 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:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true}
Session ID: 6d1f6e265b3a3e09bab5e1102f99f301
*** Element info: {Using=xpath, value=//button[@ng-show='clock']//span[contains(text(),'Clock ')]}
        at com.qandleTestScripts.QandleTest.clockIn(QandleTest.java:31)

[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]   QandleTest.clockIn:31 » NoSuchElement no such element: Unable to locate elemen...
[INFO]
[ERROR] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:27 min
[INFO] Finished at: 2021-12-11T11:48:19+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project qandle: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Wokspace_iOS_Hipi\qandle\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
PS C:\Wokspace_iOS_Hipi\qandle> docker ps
CONTAINER ID   IMAGE                         COMMAND                  CREATED          STATUS          PORTS                    NAMES
17915cf31237   healenium/hlm-backend:3.1.5   "java -Djava.securit…"   41 minutes ago   Up 41 minutes   0.0.0.0:7878->7878/tcp   qandle_healenium_1
1584be9b131c   postgres:11-alpine            "docker-entrypoint.s…"   41 minutes ago   Up 41 minutes   0.0.0.0:5432->5432/tcp   qandle_db_1
PS C:\Wokspace_iOS_Hipi\qandle> ^C
PS C:\Wokspace_iOS_Hipi\qandle>

Additional context

No response

ElenaStepuro commented 2 years ago

Hello @MaheshRamchandra ! Looks like their is no new suitable locators. Try to decrease healing score in properties file. In addition, please add another one docker container: selector-imitator: image: healenium/hlm-selector-imitator:1 restart: on-failure ports: