healenium / healenium-appium

Self-healing library for Appium-based tests
Apache License 2.0
26 stars 8 forks source link

[Need support]: unable to adjust the score property #50

Open lknguyen0 opened 2 years ago

lknguyen0 commented 2 years ago

Describe the problem

During the healing process, I am getting the error message "Score property = 0.6 is bigger than healing's locator score". I have an healenium.properties file in src/test/resources and adjusted the score-cap to 0.5 in this file. However, this does not have an impact on the healing, since I am still getting the same error message saying the score property is 0.6. Am I missing out something?

Healenium Backend version

3.2.2

Healenium Appium version

1.2.5

Selenium version

No response

Platform

Java

Logs appeared during using Healenium

Trying to heal...
[main] WARN com.epam.healenium.processor.ImitateProcessor - New element locators have not been found.
Score property = 0.6 is bigger than healing's locator score

Properties file:
heal-enabled = true
serverHost = localhost
serverPort = 7878
recovery-tries = 3
score-cap = 0.5
basePath = "target/selenium"
reportPath = "target/reports"
screenshotPath = "target/screenshots/"
backend-integration = true

Additional context

No response

Alex-Reif commented 2 years ago

Hello @lknguyen0 It means there is no available candidates to heal broken element. Could you explain more detail how do you broke element on the page ?

lknguyen0 commented 2 years ago

Hello @Aliaksei-Ashukha,

I executed a successful test before using the following locator:

    @AndroidFindBy(accessibility = "login_overlay_button_login")
    private MobileElement loginButton;

This locator and its node path is saved to the database as I can see when accessing the database:

Screenshot 2022-04-25 at 11 23 21

Then, I built a new app and changed the accessibility id to: "login_overlay_button_login_1". I ran the same test and am getting the above error message saying that the score is not high enough for healing.

Since I am using Spring in the project setup, the class name and the method name are not saved properly to the database as you can see in the attached screenshot. Do you think this is a problem when working with healenium?

Alex-Reif commented 2 years ago

No, class name and method are not associated with the issue. Can I ask you to share your app and test project? Is it possible? It helps to solve the issue.

lknguyen0 commented 2 years ago

Hi @Aliaksei-Ashukha, please find the test project and the apps here: testproject and please note that I needed to reconstruct the issue with a different app than I used before.

Old selector: driver.findElement(MobileBy.AccessibilityId("button_login") New selector: "button_login_1"

Alex-Reif commented 2 years ago

@lknguyen0 Thanks for your test project. We'll investigate the bug.