Giter VIP home page Giter VIP logo

healenium-example-maven's Introduction

Healenium

Docker Pulls License @healenium

Table of Contents

Overall information

Healenium installation

Healenium installation without Docker

Language Examples

Overall information

Self-healing framework based on Selenium and able to use all Selenium supported languages like Java/Python/JS/C# Healenium acts as proxy between client and selenium server.

Docker-compose includes the following services:

  • postgres-db (PostgreSQL database to store etalon selector / healing / report)
  • hlm-proxy (Proxying client requests to the Selenium server.)
  • hlm-backend (CRUD service)
  • selector imitator (Convert healed locator to convenient format)
  • selenoid/selenium-grid (Selenium server)

image

Healenium installation

Clone Healenium repository:

git clone https://github.com/healenium/healenium.git

Run Healenium with Selenium-Grid:

docker-compose up -d

Run Healenium with Selenoid:

docker-compose -f docker-compose-selenoid.yaml up -d

Run Healenium with Appium only

docker-compose -f docker-compose-appium.yaml up -d

More details about integration Healenium with Appium here

Healenium installation without Docker

Go to shell-installation:

cd shell-installation

There are web and remote options to run healenium.

  1. Start PostgeSql server.
  • Create user (healenium_user/YDk2nmNs4s9aCP6K) (example data)
  • Set attribute 'Can Login' (true) to user
  • Create database (healenium) and set owner healenium_user
  • Create schema (healenium) and set owner healenium_user
  1. Specify your db user and password data in the bash script 'start_healenium.sh'.

  2. Setup selenium server (selenium-grid)

Download healenium services

download_services.sh

Run shell command to launch healenium components

start_healenium.sh

Language examples

    /**
    * "http://127.0.0.1:8085" OR "http://localhost:8085" if you are using locally running proxy server
    *
    * if you want to use a remote proxy server,
    * specify the ip address of this server - "http://remote_ip_address:8085"
    */
Java:
    String nodeURL = "http://localhost:8085";

    ChromeOptions options = new ChromeOptions();
    options.addArguments("--no-sandbox");
    options.addArguments("--disable-dev-shm-usage");

    WebDriver driver = new RemoteWebDriver(new URL(nodeURL), options);
Python
    nodeURL = "http://localhost:8085"
    
    options = webdriver.ChromeOptions()
    options.add_argument('--no-sandbox')
    
    current_webdriver = webdriver.Remote(
        command_executor=nodeURL,
        options=options,
    )
C#
    String nodeURL = "http://localhost:8085";

    ChromeOptions optionsChrome = new ChromeOptions();
    optionsChrome.AddArguments("--no-sandbox");
    
    RemoteWebDriver driverChrome = new RemoteWebDriver(new Uri(nodeURL), optionsChrome);
JavaScript
    const NODE_URL = "http://localhost:8085";

    let args = [
        "--no-sandbox"
    ];

    let chromeCapabilities = selenium.Capabilities.chrome()
        .set('chromeOptions', { args });

    let builder = new selenium.Builder()
        .forBrowser('chrome')
        .withCapabilities(chromeCapabilities);

    let driver = await builder.usingServer(NODE_URL).build();

Community / Support

healenium-example-maven's People

Contributors

alex-reif avatar alinablazhko avatar alinaselyutina avatar elenastepuro avatar gannachernyshova avatar osandadeshan avatar rakesh-vardan avatar shreekanthpuppala avatar stepuroelena avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

healenium-example-maven's Issues

Plugin could not be resolved. Ensure the plugin's groupId, artifactId and version are present. Additional information: Unable to resolve com.epam.healenium:hlm-report-mvn[Need support]:

Describe the problem

Plugin could not be resolved. Ensure the plugin's groupId, artifactId and version are present.

Additional information: Unable to resolve com.epam.healenium:hlm-report-mvn

Healenium Proxy version

3.2.4

Healenium Backend version

3.2.4

Selenium version

No response

Logs appeared during using Healenium

Plugin could not be resolved. Ensure the plugin's groupId, artifactId and version are present.

Additional information: Unable to resolve com.epam.healenium:hlm-report-mvn

Additional context

No response

[Need support]: New element locator have not been found. There is no reference data to selector in the database.

Describe the problem

I have read your FAQ section and also update the latest version of healenium web, selenium java according to the docker-compose.yml file but still get the same issue i am using docker please healp it is very urgent.

Console log.

[RemoteTestNG] detected TestNG version 7.8.0
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.collectMethodsByGroup() took 0 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.sortMethods() took 2 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.collectMethodsByGroup() took 10 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.sortMethods() took 18 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.collectMethodsByGroup() took 0 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.sortMethods() took 1 ms.
[main] WARN org.testng.internal.Configuration - Detected a static method [demoHealenium.HealeniumDemoWithDocker.startTest()]. Static configuration methods can cause unexpected behavior.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.collectMethodsByGroup() took 0 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.sortMethods() took 1 ms.
[main] WARN org.testng.internal.Configuration - Detected a static method [demoHealenium.HealeniumDemoWithDocker.endTest()]. Static configuration methods can cause unexpected behavior.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.collectMethodsByGroup() took 0 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.sortMethods() took 0 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.collectMethodsByGroup() took 0 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.sortMethods() took 0 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.collectMethodsByGroup() took 0 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.sortMethods() took 0 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.collectMethodsByGroup() took 0 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.sortMethods() took 0 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.collectMethodsByGroup() took 0 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.sortMethods() took 0 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.collectMethodsByGroup() took 0 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.sortMethods() took 0 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.collectMethodsByGroup() took 0 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.sortMethods() took 0 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.collectMethodsByGroup() took 1 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.sortMethods() took 1 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.collectMethodsByGroup() took 1 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.sortMethods() took 1 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.collectMethodsByGroup() took 1 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.sortMethods() took 0 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.collectMethodsByGroup() took 0 ms.
[main] INFO org.testng.internal.Utils - [Utils] MethodGroupsHelper.sortMethods() took 0 ms.
[main] INFO org.testng.internal.Utils - [TestNG] Running:
C:\Users\DYNAMIC MONSTERS\AppData\Local\Temp\testng-eclipse--1771937419\testng-customsuite.xml

[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Using chromedriver 114.0.5735.90 (resolved driver for Chrome 114)
[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Exporting webdriver.chrome.driver as C:\Users\DYNAMIC MONSTERS.cache\selenium\chromedriver\win32\114.0.5735.90\chromedriver.exe
Starting ChromeDriver 114.0.5735.90 (386bc09e8f4f2e025eddae123f36f6263096ae49-refs/branch-heads/5735@{#1052}) on port 31948
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Sep 11, 2023 5:23:57 PM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
WARNING: Unable to find an exact match for CDP version 114, so returning the closest version found: 112
[main] INFO org.testng.internal.Utils - [Utils] DynamicGraphHelper.createDynamicGraph() took 7 ms.
[main] WARN healenium - Failed to find an element using locator By.cssSelector: [name='Name']
[main] WARN healenium - Reason: no such element: Unable to locate element: {"method":"css selector","selector":"[name='Name']"}
(Session info: chrome=114.0.5735.134)
For documentation on this error, please visit: https://selenium.dev/exceptions/#no_such_element
Build info: version: '4.9.0', revision: 'd7057100a6'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '20.0.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [c7149607805ddac2e88e937615951127, findElement {using=css selector, value=[name='Name']}]
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 114.0.5735.134, chrome: {chromedriverVersion: 114.0.5735.90 (386bc09e8f4f..., userDataDir: C:\Users\DYNAMI~1\AppData\L...}, goog:chromeOptions: {debuggerAddress: localhost:59242}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: WINDOWS, proxy: Proxy(), se:cdp: ws://localhost:59242/devtoo..., se:cdpVersion: 114.0.5735.134, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}
Session ID: c7149607805ddac2e88e937615951127
[main] WARN healenium - Trying to heal...
[main] WARN healenium - New element locator have not been found. There is no reference data to selector in the database.
Make sure that:

  • There is selector on the page http://localhost:7878/healenium/selectors/ and type: single, if not then you have to run successful tests.
  • Your locator was changed on the page and not in code.
    FAILED: demoHealenium.HealeniumDemoWithDocker.healeniumDemoWithDocker
    org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":"[name='Name']"}
    (Session info: chrome=114.0.5735.134)
    For documentation on this error, please visit: https://selenium.dev/exceptions/#no_such_element
    Build info: version: '4.9.0', revision: 'd7057100a6'
    System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '20.0.1'
    Driver info: org.openqa.selenium.chrome.ChromeDriver
    Command: [c7149607805ddac2e88e937615951127, findElement {using=css selector, value=[name='Name']}]
    Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 114.0.5735.134, chrome: {chromedriverVersion: 114.0.5735.90 (386bc09e8f4f..., userDataDir: C:\Users\DYNAMI~1\AppData\L...}, goog:chromeOptions: {debuggerAddress: localhost:59242}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: WINDOWS, proxy: Proxy(), se:cdp: ws://localhost:59242/devtoo..., se:cdpVersion: 114.0.5735.134, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}
    Session ID: c7149607805ddac2e88e937615951127
    at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:67)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:484)
    at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:200)
    at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:133)
    at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:53)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:193)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:183)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:158)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
    at org.openqa.selenium.remote.ElementLocation$ElementFinder$2.findElement(ElementLocation.java:162)
    at org.openqa.selenium.remote.ElementLocation.findElement(ElementLocation.java:60)
    at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:352)
    at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:344)
    at com.epam.healenium.processor.FindElementProcessor.execute(FindElementProcessor.java:23)
    at com.epam.healenium.processor.BaseProcessor.process(BaseProcessor.java:42)
    at com.epam.healenium.handlers.proxy.BaseHandler.findElement(BaseHandler.java:60)
    at com.epam.healenium.handlers.proxy.SelfHealingProxyInvocationHandler.invoke(SelfHealingProxyInvocationHandler.java:39)
    at jdk.proxy2/jdk.proxy2.$Proxy15.findElement(Unknown Source)
    at demoHealenium.HealeniumDemoWithDocker.healeniumDemoWithDocker(HealeniumDemoWithDocker.java:204)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at java.base/java.lang.reflect.Method.invoke(Method.java:578)
    at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139)
    at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:664)
    at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:227)
    at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50)
    at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:957)
    at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:200)
    at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:148)
    at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.testng.TestRunner.privateRun(TestRunner.java:848)
    at org.testng.TestRunner.run(TestRunner.java:621)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:443)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:437)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:397)
    at org.testng.SuiteRunner.run(SuiteRunner.java:336)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:95)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1280)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1200)
    at org.testng.TestNG.runSuites(TestNG.java:1114)
    at org.testng.TestNG.run(TestNG.java:1082)
    at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)

===============================================
Default test
Tests run: 1, Failures: 1, Skips: 0

===============================================
Default suite
Total tests run: 1, Passes: 0, Failures: 1, Skips: 0

[main] INFO org.testng.internal.Utils - [TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@7c5df615: 53 ms
[main] INFO org.testng.internal.Utils - [TestNG] Time taken by org.testng.reporters.jq.Main@12952aff: 137 ms
[main] INFO org.testng.internal.Utils - [TestNG] Time taken by org.testng.reporters.FailedReporter@14b31e37: 89 ms
[main] INFO org.testng.internal.Utils - [TestNG] Time taken by org.testng.reporters.XMLReporter@11c78080: 38 ms
[main] INFO org.testng.internal.Utils - [TestNG] Time taken by org.testng.reporters.EmailableReporter2@616a06e3: 18 ms
[main] INFO org.testng.internal.Utils - [TestNG] Time taken by org.testng.reporters.JUnitReportReporter@17222c11: 15 ms
[main] INFO org.testng.internal.Utils - [TestNG] Time taken by org.testng.internal.ExitCodeListener@2db15f70: 0 ms

and also i have attached my project please help i have tried all the possible solution ;-
demo.zip

Healenium Proxy version

1.3.0

Healenium Backend version

3.3.4

Selenium version

4.9.0

Logs appeared during using Healenium

NA

Additional context

this is my screenshot of docker.

Screenshot (202)
Screenshot (203)

if you want to contact me for the help you can directly ping me on my mail :- [email protected]
please healp

[Need support]: To add Healenium Dependency

Describe the problem

I tried to add the dependency but i am getting the following issue
Screenshot from 2022-06-19 14-01-53
Screenshot from 2022-06-19 14-02-00

Healenium Proxy version

NA

Healenium Backend version

3.2.4

Selenium version

4.2.2

Logs appeared during using Healenium

Unresolved dependency: 'junit:junit:jar:5.8.1'

Additional context

No response

[BUG]: Yaml file and sql file curl pull link not working

Describe the bug

**$ curl https://raw.githubusercontent.com/healenium/healenium-example-maven/master/infra/docker-compose.yaml -o docker-compose.yml

$ curl https://raw.githubusercontent.com/healenium/healenium-client/master/example/init.sql -o init.sql**

Both these links are not working

How to reproduce the issue

$ curl https://raw.githubusercontent.com/healenium/healenium-example-maven/master/infra/docker-compose.yaml -o docker-compose.yml
$ curl https://raw.githubusercontent.com/healenium/healenium-client/master/example/init.sql -o init.sql

Copy these links and then in terminal (using IntelliJ IDEA) paste them, and they will give response 
curl : 404: Not Found

Logs appeared during using Healenium

curl : 404: Not Found
At line:1 char:1
+ curl https://raw.githubusercontent.com/healenium/healenium-example-ma ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Expected behavior

It should pull the file from the provided link

Actual behavior

curl : 404: Not Found
At line:1 char:1

Healenium Proxy version

None

Healenium Backend version

just started pulling the backend file but it is failing with the provided link

Selenium version

4

Additional context

No response

New element locator have not been found. There is a lack of reference data.

Describe the problem

ERROR n.t.c.s.ConsoleLoggingListener - no such element: Unable to locate element: {"method":"css selector","selector":"*[name='Username']"}

Healenium Proxy version

healenium-web 3.2.1

Healenium Backend version

healenium-back version 3.2.0

Selenium version

3.141.159

Logs appeared during using Healenium

Element info: {Using=id, value=loginButton}
Trying to heal...
18:00:13.662 [main] WARN  c.e.h.p.SaveHealingResultsProcessor - Using healed locator: Scored(score=0.8571428571428571, value=By.cssSelector: input#hj)


*** Element info: {Using=name, value=Username}
Trying to heal...
18:01:27.877 [main] WARN  c.e.h.p.HealingProcessor - New element locator have not been found. There is a lack of reference data.
ERROR n.t.c.s.ConsoleLoggingListener - no such element: Unable to locate element: {"method":"css selector","selector":"*[name='Username']"}

Additional context

As per the above context of logs..

The healenium is working for first element. But it is not working for secnd one..

Have tried by decreasing healing score in properties file.
In addition, also added one docker container:
selector-imitator:
image: healenium/hlm-selector-imitator:1
restart: on-failure
ports:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.