Course: Self-healing — 2. Lab setup
Prepare the lab once, before the exercises. You work in three places:
| Where | What it is | Used for |
|---|---|---|
| Terminal | PowerShell in the AutoTestX folder | Starting the Maximo drift proxy (once) |
| AutoTestX | The AutoTestX web app, e.g. http://localhost:4100 |
Building and running the practice test, rules, reviewing fixes |
| Maximo | Maximo opened through the proxy, e.g. http://localhost:4411/maximo |
Checking each “release” works and that work orders were saved |
Use a practice project, not one with real tests: the exercises create and delete rules, and rules apply to the whole project.
Why a drift proxy
Section titled “Why a drift proxy”Self-healing only starts when a locator breaks, which normally happens after an upgrade. You cannot upgrade Maximo on demand, so the drift proxy serves your Maximo as seven “releases”. For each, it renames some element ids in the browser only, the way an upgrade would. Maximo’s server is not changed and Maximo keeps working; only the test’s recorded locators stop matching.
| Release | Address | Renamed in the browser | Used to show |
|---|---|---|---|
| v1 | http://localhost:4411/maximo |
Nothing | The baseline every exercise starts from |
| v2 | http://localhost:4412/maximo |
Ids of the New Work Order, Save and Change Status toolbar icons | Fixes found by a backup locator (Tier 0) |
| v3 | http://localhost:4413/maximo |
Save again (id, link, position); every icon’s style class | A new Save fix after a revert |
| v4 | http://localhost:4414/maximo |
v2 plus the login page’s User name field and Sign In button | Five broken steps in one run |
| v5 | http://localhost:4415/maximo |
The login page’s Password field | A high-risk step |
| v6 | http://localhost:4416/maximo |
Every toolbar icon and the link around it | Backup locators that match several icons |
| v7 | http://localhost:4417/maximo |
v3 plus Save’s tooltip | A fix that stops working (circuit breaker) |
1. Start the drift proxy (Terminal)
Section titled “1. Start the drift proxy (Terminal)”- Open PowerShell and go to the AutoTestX folder, e.g.
Terminal window cd "D:\AI Agents\Claude\agents\auto-test" - Start the proxy, giving your Maximo server’s address:
In bash:
Terminal window $env:MAXIMO_URL = "http://192.168.206.135"; npm run maximo:driftMAXIMO_URL=http://192.168.206.135 npm run maximo:drift. - Expected: one line per release,
v1 http://localhost:4411/maximo as installedtov7 http://localhost:4417/maximo …, thenProxying http://192.168.206.135. - Leave the window open during the course. Closing it (or Ctrl+C) stops Maximo for the tests.
| Problem | Fix |
|---|---|
EADDRINUSE |
Another program uses the ports. Add $env:DRIFT_BASE_PORT = "4511"; before npm run … and use ports 4511-4517 everywhere below |
| Pages say Maximo drift proxy: … is not reachable | Maximo is down or the address is wrong. Check you can open Maximo directly |
| No Maximo available | npm run maximo:drift -- --stub serves a small stand-in with the same ids |
2. Check the releases (Maximo)
Section titled “2. Check the releases (Maximo)”Do this for v1 and for v2:
- Open
http://localhost:4411/maximo/webclient/login/login.jsp. Expected: the Maximo login page. - Sign in with your Maximo user.
- Open
http://localhost:4411/maximo/ui/?event=loadapp&value=wotrack. Expected: Work Order Tracking. - Click New Work Order, type
proxy checkin Description, click Save. Expected: the message bar showsBMXAA4205I(record saved). - Repeat with port 4412. Expected: the same.
- (Optional, to see the drift) On 4412 right-click the Save icon → Inspect.
Its
idistbar_SAVE_btn; on 4411 it istoolactions_SAVE-tbb_image.
Each port is a separate site for the browser, so you sign in to Maximo on each one.
3. Create the environments (AutoTestX)
Section titled “3. Create the environments (AutoTestX)”- Sign in to AutoTestX as an Admin and select the practice project.
- Repeat for v1 … v7:
- Sidebar → Configurations → Environments → New environment.
- Name:
Maximo v1(thenMaximo v2, …). - Variables (JSON):
{ "maximoUrl": "http://localhost:4411/maximo" }, with the release’s port (4411 for v1 … 4417 for v7). - Save environment.
- Under Add a secret: NAME
MAXIMO_USER, your Maximo user → Add secret. - NAME
MAXIMO_PASSWORD, the password → Add secret. - Expected: both secrets listed as set.
4. Build the practice test MX WO toolbar (AutoTestX)
Section titled “4. Build the practice test MX WO toolbar (AutoTestX)”- Sidebar → Testing → Test Cases → New test. Name
MX WO toolbar, Who can see it Shared → Create. - Test (right-hand rail) → Default timeout: 15 seconds or more. Maximo is slow to redraw.
- Add the steps below. For each: Add → search the action → pick it → click the step → in Step properties fill Step name, the parameters and Target strategies (kind and value). Do not add fallbacks: the exercises depend on these exact locators.
| # | Step name | Action | Target | Parameters |
|---|---|---|---|---|
| 1 | Open Maximo |
Open | n/a | url {{maximoUrl}}/webclient/login/login.jsp |
| 2 | Enter user name |
Type | css #username |
value {{secret.MAXIMO_USER}}, clear first |
| 3 | Enter password |
Type | css #password |
value {{secret.MAXIMO_PASSWORD}}, sensitive, clear first |
| 4 | Sign in to Maximo |
Click | css #loginbutton |
n/a |
| 5 | Open Work Order Tracking |
Open | n/a | url {{maximoUrl}}/ui/?event=loadapp&value=wotrack |
| 6 | Click New Work Order |
Click | css #toolactions_INSERT-tbb_image |
n/a |
| 7 | Enter Description |
Type | label Description |
value AutoTestX self-heal check, clear first |
| 8 | Point at Change Status |
Hover | css #toolactions_STATUS-tbb_image |
n/a |
| 9 | Click Save |
Click | css #toolactions_SAVE-tbb_image |
n/a |
| 10 | Verify record saved |
Text (validation) | css #titlebar_error |
expected BMXAA4205I, match contains |
- Save. Run it on Maximo v1 (procedure P1 below). Expected: PASS 10/10. If a step fails, your Maximo’s ids may differ: correct that step before going on.
This test is the template: every exercise works on a copy of it.
Procedures used in the exercises
Section titled “Procedures used in the exercises”The exercises refer to these by number.
P1. Run a test on a release
Section titled “P1. Run a test on a release”- Open the test. In the environment selector above the steps choose e.g.
Maximo v2. - Run test (if asked, Run saved version). Turn on Watch first to see the browser.
- The Run result panel shows each step as PASS, WARN, FAIL or SKIP, and RESULT n/10.
- Wait about 5 seconds before looking at Self-healing: rules act just after a run finishes.
See Running tests and reading reports.
P2. Start an exercise with a fresh copy
Section titled “P2. Start an exercise with a fresh copy”- Test Cases → Duplicate on
MX WO toolbar. Rename the copy, e.g.MX TC-04, Save. - Run it on Maximo v1 (P1). Expected: PASS 10/10. This baseline run records how each element looks; healing compares against it.
A fresh copy per exercise keeps results clean and gives a fresh allowance of 3 automatic fixes per 24 hours.
P3. Open Self-healing for one test
Section titled “P3. Open Self-healing for one test”- Open the test. If fixes wait, a banner says N self-healing suggestion(s) … waiting for review. Click Review. Or: Self-healing → Suggestions and click the test’s name on a card.
- Tabs: Pending, Approved, Rejected, No longer applies, Replaced, Reverted. The chip Decided by a rule keeps only what a rule decided.
- Always click the tab you need: the page keeps the last tab, even for another test.
- After a run, press F5 to reload.
P4. Create a rule
Section titled “P4. Create a rule”- Self-healing → Rules → New rule.
- Set what the exercise says; leave the rest:
| Field | How |
|---|---|
| Name | Type it |
| Action | Apply automatically / Always require review / Reject automatically |
| Mode | Dry run - only record what it would do (default) or Active |
| Priority | Lower runs first |
| Applies to | All tests, or untick it and tick tests; Suites and Components are tick-lists |
| Healing tier | Keep Fallbacks and element matches (tier ≤ 1) |
| Minimum confidence (%) | e.g. 80 |
| Risk | Tick low / medium |
| Seen in at least (runs) | e.g. 1 |
| Step types | e.g. click; empty means any |
| A fix to a Ready test | Only for Apply automatically |
- Save. Expected: toast Saved “<name>” as v1 and a card for the rule.
The standard click rule, used by most exercises: Apply automatically, Active,
untick All tests and tick the exercise’s test, confidence 80, tick medium
(low stays ticked), seen in 1, step types click. In words: for this test only, when
a Click step’s locator breaks and AutoTestX is at least 80% sure, and the step is not
high-risk, write the fix into the test at once.
P5. Look at one step of a run report
Section titled “P5. Look at one step of a run report”- Test Runs → click the run.
- The first step is open; click another step’s row (e.g. 9. Click Save) to open it.
- It shows Primary / Fallback / Healed locator, a note picked #… of N matches when the run had to choose, and the self-healing panel (Tier, Confidence, Risk, Was / Proposed, Review suggestion →).
P6. Open the audit trail
Section titled “P6. Open the audit trail”Self-healing → Audit trail, or from a test History → Self-healing audit trail for this test. Views: Changes, Fixes and reverts, Held back, Rule changes, Everything. Click Evidence on an entry for tier, confidence, risk and the reasons.
P7. Check a work order in Maximo
Section titled “P7. Check a work order in Maximo”Open the release’s Maximo, sign in, open …/ui/?event=loadapp&value=wotrack → List →
filter Description = AutoTestX self-heal check. Each successful Save of a run is one work order.
P8. Clear the previous exercise’s rules
Section titled “P8. Clear the previous exercise’s rules”Do this at the start of an exercise, before P4. It removes what earlier exercises left; never the rule you are about to test.
- Self-healing → Rules: Delete every
TC-…rule (confirm OK). - Under Paused for a test (if shown): Let it fix again on each entry.
- Rules not made by this course: Disable any enabled rule that covers All tests while you train; it would act on your copies too.
Order in every exercise: P8 → P2 → P4 → run and check.
Next: Exercises.