Skip to main content

Examples

All examples target a placeholder domain. Use these patterns only with systems you are authorised to test.

A simple page visit with a check​

Headless: true
NeedVideo: false
Actions:
- Do: Page_GotoAsync
Data1: https://your-test-environment.example
- Do: Expect_Title
Data1: Your product
- Do: Expect_Visible
Target: heading=Welcome

Fill a form and verify the result​

Name: Contact form
Headless: true
NeedVideo: false
Actions:
- Do: Page_GotoAsync
Data1: https://your-test-environment.example/contact
- Do: Fill
Target: label=Full name
Value: "{{random.name}}"
- Do: Fill
Target: label=Email || placeholder=you@example.com
Value: test.user@example.invalid
- Do: Select
Target: label=Topic
Value: Billing
- Do: Check
Target: label=Send me a copy
- Do: Click
Target: button=Send message
- Do: Expect_Text
Target: role=status
Value: Thanks, we will be in touch
- Do: Expect_Url
Data1: /contact/thanks

Sign in with a secret kept outside the workflow​

Headless: true
NeedVideo: false
Actions:
- Do: Page_GotoAsync
Data1: https://your-test-environment.example/sign-in
- Do: Fill
Target: label=Email address
Value: test.user@example.invalid
- Do: Fill
Target: label=Password
Value: "{{env:PAXTER_TEST_PASSWORD}}"
Secret: true
- Do: Press
Target: label=Password
Key: Enter
- Do: Expect_Hidden
Target: button=Sign in
- Do: Expect_Visible
Target: link=Sign out

Set PAXTER_TEST_PASSWORD in the environment that runs Paxter. The value is never written to the console, the report, or output.json.

Capture a value and compare it later​

Headless: true
NeedVideo: false
Actions:
- Do: Page_GotoAsync
Data1: https://your-test-environment.example/orders/new
- Do: Click
Target: button=Create order
- Do: ReadInnerText
Target: css=.order-reference
Data2: __reference
Pipe: trim
- Do: Click
Target: link=All orders
- Do: Expect_Text
Target: css=table tbody tr;first
Value: "{{__reference}}"
- Do: Expect_Count
Target: css=table tbody tr
Value: 1

Run the same checks for every row of a spreadsheet​

price-cases.csv

CaseName,Quantity,Coupon,ExpectedTotal,ExpectedOutcome
Single item,1,,19.99,pass
Bulk discount,10,,179.91,pass
Coupon applied,2,SAVE10,35.98,pass
Expired coupon,1,OLD,19.99,fail

pricing.yaml

Name: Pricing rules
Headless: true
NeedVideo: false
DataSource:
Path: price-cases.csv
Actions:
- Do: Page_GotoAsync
Data1: https://your-test-environment.example/cart
- Do: Fill
Target: label=Quantity
Value: "{{Quantity}}"
- Do: Fill
Target: label=Coupon code
Value: "{{Coupon}}"
- Do: Click
Target: button=Apply
- Do: Expect_Text
Target: css=.total
Value: "{{ExpectedTotal}}"
Mode: exact
paxter validate pricing.yaml
paxter run pricing.yaml

The "Expired coupon" row is a negative case: the expected total is deliberately wrong, so the case passes only when the assertion fails. See data-driven testing for Excel input, row selection, and the suite report.

Continue past a non-essential step​

- Do: Click
Name: Dismiss the cookie banner if it is shown
Target: button=Accept all
Optional: true

An optional step that fails is recorded as a warning and the workflow continues. The run still passes.

See Workflow actions for the complete action set and Targets for the target syntax.