Closed raghunadh10 closed 1 year ago
Hello @raghunadh10 , this issue means that example locator wasn't added into db. Please, before run test with healing, run test with correct locators. this is how healenium understands that element should be healed. You can find explanation in documentation: https://healenium.io/docs
Hii @ElenaStepuro . i have already ran the tests using correct locators for first time . they got stored in db. Whats happening is it isnt healing the elements which are inside the iframe . those elements have already stored in db too .i have cross checked them to ensure . could it be due to iframe thing elena ? If any inputs are needed , please intimate me
Hi @ElenaStepuro even i'm also facing the same issue with Iframe, but for me i cannot see any errors related to unable to locate the element. But it's not going inside the iframe
HI @raghunadh10 @ElenaStepuro @Aliaksei-Ashukha ,
I tried to run a simple script to duplicate the Iframe problem.I wrote a script for Yopmail. And once the mail is received, there will be a clickable link within the iframe. Here are the details about the frame. ( In the below attached screen, the ID and Name where same i.e "Ifmail". I updated the name to see if the healing is happening for the Updated Name's element)
I tried to update id and name separately from multiple analyzes. And attempted to click the link present in Iframe. The script runs flawlessly. But I can see only the Link related xpath change reflecting in the report that i have updated, the iframe that i updated is not reflecting.
Please give me your comments in that regard.
Hi @Vishnupk1993 . are you concluding that the link present inside the iframe is getting clicked ?
@raghunadh10 Yes i'am. IT's getting clicked. But the Frame ID which i updated during debugging is not showing in the console's healed result. And the Healed Report.
@ElenaStepuro @raghunadh10 @Aliaksei-Ashukha A small doubt based on the docker. Currently i'm using docker desktop community edition Version 2.0.0.3 . Is it possible to view the locators stored in the backend with the same? or is there any other way through which we can view these ?
Hi @Vishnupk1993 . based on your iframe example thing, i understand as follows . you have one xpath for the link inside the iframe .here you arent changing the xpath of the link inside iframe but you are tyring to change the name and id of the iframe webelement and running the script right . correct me if i wrong .
In my case , what i am trying to do is , i am changing the xpath that is attributes of that webelement which is inside the frame not the iframe attributes and i am running it , it is unable to locate it and its getting failed
@ElenaStepuro @raghunadh10 @Aliaksei-Ashukha A small doubt based on the docker. Currently i'm using docker desktop community edition Version 2.0.0.3 . Is it possible to view the locators stored in the backend with the same? or is there any other way through which we can view these ?
I think we can, by connecting to docker and sql terminal , by running the respective commands we can get access to the locators . but in my case , i am not using docker , i installed them(server, imitator, database) separately on my local machine . so i am able to see backend data easily using pgadmin which is a gui for postgre . will try to provide more data for your case soon.
Hi @Vishnupk1993 , Yes, you can check stored locators. I recommend use PGAdmin for postgres database.
@raghunadh10 , @Vishnupk1993 , could you share project where we can face issues? It helps to investigate problem quickly.
Hi @Aliaksei-Ashukha @ElenaStepuro @Vishnupk1993 . i have one question . whenever an element is not found , healenium tries to search for the reference data from the database right . if it doesnt , it says there is a lack of reference data . so what columns will healenium fetch from the db for referencing purpose .is it like specific columns or combination of all columns or some columns . can you please provide me this data . The reason im asking this is , when i run my test script, the url part data is changing dynamically everytime . so healenium unable to get the reference data from db due to change in url everytime . can you please help me regarding this . if you need any inputs, please intimate me .
hi @raghunadh10 application looks at selector table on the full row. Currently we work on url independency
Hi @ElenaStepuro .thank you for your answer. Also can you give me an ETA when this url independency will be done because the dynamic url is causing healenium to unable to heal the element . This is an issue right or is there an temporary alternative solution for this ?
Hi @raghunadh10 , Solution to support dynamic url was released at hlm-backend 3.2.4 From hlm-backend 3.2.4, client able to adjust build selector key by using KEY_SELECTOR_URL and KEY_SELECTOR_PATH flags.
Example: https://www.google.com/imghp
KEY_SELECTOR_URL - url participates to build selector key. (https://www.google.com) KEY_SELECTOR_PATH - path participates to build selector key. (/imghp)
By default both filled as true.
To fix your issue by 'url independency' please use hlm-backend 3.2.4 and set environment: - KEY_SELECTOR_URL=false . Here only the addition path will be include in a selector key
Also from hlm-backend 3.2.4 you can check your stored selector via request /healenium/selectors
For locally: http://localhost:7878/healenium/selectors
Hi @Aliaksei-Ashukha @ElenaStepuro . Thank you for the release . will check on my end and update you . can we get the jar file please as i cannot see it on the releases page of hlm-backend . i am trying without docker actually.
Hi @Aliaksei-Ashukha i have build and got jar file using the source code and tried to run . but while running using the above mentioned flag (KEY_SELECTOR_URL) , the issue is still same .healenium is saying there is lack of reference data due to change in url everytime i run the script. please check into this
NOTE -- IN my case , the part of the url is changing like this which is in the bold part . Example --
https://sample.com/login/uri=%2Fcase.do%3Fsys_id% 3De73b1eaf1be5d51472e0eca6bd4bcb4e %26sysparm_view https://sample.com/login/uri=%2Fcase.do%3Fsys_id% 3Dd43256ny3ge7q41235e7yrh7cf5ffe2a %26sysparm_view . everytime , it is storing a new row for this in db . so when i am trying to heal in the new test run, it is looking for new url which wont be available in db and throwing the error ( New element have not been found . there is lack of reference data).
Command -- java -jar healenium-backend-3.2.4.jar --SPRING_POSTGRES_DB=healenium --SPRING_POSTGRES_SCHEMA=healenium --SPRING_POSTGRES_USER=healenium_user --SPRING_POSTGRES_PASSWORD=YDk2nmNs4s9aCP6K --KEY_SELECTOR_URL=false
Facing the similar issue. I have also tried updating the postgresdb in runtime by updating the url column to to current url but its not working as well. I debugged and saw that it has to do with the RestClient.java Class
In the below snippet of the code from RestClient class, response.body().string() is returning empty nodepath. But in case when healing happens, it returns the nodepath body properly.
try (Response response = okHttpClient().newCall(request).execute()) {
if (response.code() == 200) {
String result = response.body().string();
lastHealingDataDto = objectMapper.readValue(result, new TypeReference
Any help would be appreciated Thanks
Hi @sambeetmohapatra , You don't have to update database, it wont help. You should use KEY_SELECTOR_URL=false in hlm-backend container and again run success test to store etalon data to db. Also you can use /healenium/selectors request to look your stored selectors in the database. And check actual data Example request: http://localhost:7878/healenium/selectors
Hi Aliaksei-Ashukha, Thanks for the response. In our url, there are certain values that keep changing after logging in. And after each login, those values differ from the previous url values. So now, will the KEY_SELECTOR_URL=false in yml file while setting up hlm-backend container suffice ? Also, we are using 3.2.4 hlm-backend version. Please let us know. Thank you
There is 2 flags in the hlm-backend container to change the behavior.
By default, both have value true.
Example: http://google.com/images If you don't want to use even path (/images) you can also turn off it using - KEY_SELECTOR_PATH=false
Hi Aliaksei-Ashukha, This seems to be working now. URL is not taken into consideration anymore. Thank you for the help.
Hi Aliaksei-Ashukha, I am trying to set up the Healenium with out docker can you please help me out how to how to disable the url being captured and used for healing. I am using the 3.4.1 hlm-backend version, and 1.3.6 helenium version. Alos i have updated
i have modified start helenium server command this way. HLM_SELECTOR_URL=false HLM_SELECTOR_PATH=false
SPRING_POSTGRES_DB=$HLM_POSTGRES_DB SPRING_POSTGRES_SCHEMA=$HLM_POSTGRES_SCHEMA SPRING_POSTGRES_USER=$HLM_POSTGRES_USER SPRING_POSTGRES_PASSWORD=$HLM_POSTGRES_PASSWORD COLLECT_METRICS=$HLM_COLLECT_METRICS SPRING_SERVER_PORT=$HLM_SERVER_PORT HLM_LOG_LEVEL=$HLM_LOG_LEVEL KEY_SELECTOR_URL=$HLM_SELECTOR_URL KEY_SELECTOR_PATH=$HLM_SELECTOR_PATH java -jar hlm-backend.jar 2>&1 & echo $! > ./pid-hlm-backend.file &
But still i see that the url is being captured and used for healing. Can you please help me in resolving this issue.
Hi Team,
I have taken one test case and ran it successfully for first time . later i have tried healenium by changing web elements in debug mode. the issue is healenium didnt heal that web element . some of the elements got healed and some arent . suprisingly , the elements which are not healed are inside the iframe element .To ensure this , i have tested nearly 10 xpaths (locators) which are lying inside the iframe . All of them werent healed by healenium. Also i have tested around 20 xpaths which are outside iframe element , they have been healed by healenium succesfully . i wonder if this issue is related to iframe thing. i am using the latest healenium web and backend too.
Healenium Web version
3.3.0
Healenium Backend version
3.2.3
Selenium version
4.1.1
Platform
Java
Properties file
recovery-tries = 1 score-cap = 0.5 heal-enabled = true hlm.server.url = http://localhost:7878 hlm.imitator.url = http://localhost:8000
Logs appeared during using Healenium
Additional context
Thank you No response