healenium / healenium-web

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

Integrating---- Healenium with Robot Framework #156

Closed soalexan closed 2 years ago

soalexan commented 2 years ago

I am unable to integrate Healenium with Robot Framework . is there any steps is there?

ElenaStepuro commented 2 years ago

Hello @soalexan ! The steps for using the same as for python: https://github.com/healenium/healenium-example-python Examples with robot framework were not implemented yet. Sorry for inconvenience.

soalexan commented 2 years ago

Hello @ElenaStepuro Thanks! and Do we have any future plans for integrate with robot framework?

ElenaStepuro commented 2 years ago

Hello @soalexan , helenium-proxy also can be integrated with robot framework. Steps are the same as for python)

ammarisrar commented 1 year ago

Hello @ElenaStepuro and @soalexan,

I have integrated ROBOT Framework with the Healenium, and it is working flawlessly. I have done it by setting up Healenium with healenium-proxy, and then specifying the healenium-proxy URL in the remote_url parameter of the Open Browser keyword. However, the remote-url parameter seems to be missing in the Open Available Browser keyword.

soalexan commented 1 year ago

Thanks @ammarisrar can you share me the steps in detail??

ammarisrar commented 1 year ago

Sure @soalexan. I only used remote_url parameter with Open Browser keyword.

The script

Here is the official Healenium test script converted to a ROBOT script to enable healing:

*** Settings ***
Library  RPA.Browser

*** Keywords ***
Open the Test page
    Open Browser     url=https://elenastepuro.github.io/test_env/index.html  browser=chrome  remote_url=127.0.0.1:8085
    Click Element    xpath://*[@id='change:name']
    Click Element    id:Submit
    Click Element    //*[@id='change:name']

*** Test Cases ***
Test Implementation
    Open the Test Page
    [Teardown]  Close Browser Window

You'd notice 2 changes here, a remote_url parameter, which tells where healenium-proxy is running, and a new Close Browser Window keyword, which is a new keyword which only closes the browser (and not try to quit the session).

To add the new keyword

Navigate to your Python site-packages and then to SeleniumLibrary\keywords\element.py. Add the following keyword definition there:

@keyword
    def close_browser_window(self):
        self.driver.close()
soalexan commented 1 year ago

Thanks @ammarisrar did you installed docker robot framework [instead of selenium grid/ selenoid/ appium] along with helenium proxy & helenium server. ??

ankit-jhai9 commented 3 months ago

Hi @ammarisrar in the above example we check it on same session in which locators are changed in the runtime but for real life scenarios it is not working as if we are using a site in which locators are not changed in the realtime but chaging after one day or two.