Skip to main content

Self-healing

You can use Applitools Execution Cloud to apply self-healing to your tests. Self-healing menas that your tests will run smotthly even if there are changes to wen elements. For further information about the Self-healing feature, see Self-healing

The following is an example of a Robot file with self-healing applied:

*** Settings ***
Library SeleniumLibrary
Library EyesLibrary runner=web_ufg config=applitools.yaml

Test Setup Setup
Test Teardown Teardown


*** Keywords ***
Setup
${remote_url}= Get Execution Cloud URL

${selfHealingOptions} = Create Dictionary findElementsSupport=${True}
Open Browser https://demo.applitools.com chrome remote_url=${remote_url}
... options=set_capability('applitools:useSelfHealing', ${True});set_capability('browserVersion', 'latest');set_capability('selfHealingOptions', ${selfHealingOptions})
Eyes Open

Teardown
Eyes Close Async
Close All Browsers

*** Test Cases ***
Log into bank account
# Write "Not self healed" text into original username field
Input Text id:username Not self healed
Eyes Check Window Login Page Original

# Modify username field identificator and put "Self healed" text into it
${user_id_element1} Execute Javascript return window.document.querySelector("#username").id='user'+Math.round(Math.random() * 1000)
Input Text id:${user_id_element1} Self healed
Eyes Check Window Login Page Self healed