-
Notifications
You must be signed in to change notification settings - Fork 2
Native Applications Testing
Testlum allows you to perform native
application testing just like web
testing — the structure and usage of commands remain largely consistent.
The main difference is that all native-specific actions must be wrapped inside the native
tag.
⚡ Special for Native Testing:
Native testing introduces 3 additional commands:
refresh
swipeNative
webview
⚠️ Limitations in Native Testing:
The following commands available in web testing are not supported in native testing:
scroll
javascript
dropDown
include
hovers
switchToFrame
scrollTo
tab
hotKey
doubleClick
✅ Native testing is still highly flexible and allows you to cover a wide range of mobile app scenarios effectively!
<native comment="Test native behavior"> <input comment="Input user email" locator="login.email" value="test@testlum.com"/> </native>
This structure keeps your testing process consistent, organized and adaptable for mobile-specific scenarios!
refresh
The refresh
command is used to refresh the app interface if it supports "pull-to-refresh" functionality (e.g., swipe down to reload content).
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
comment |
String | ✅ | - | Description of the refresh action being performed. |
condition |
Boolean | ❌ | - | Condition to decide if this step should be executed. |
threshold |
Integer (ms) | ❌ | - | Maximum allowed execution time; step fails if exceeded. |
<refresh comment="Refreshing the app content"/>
✅ Tip:
- Use the
refresh
command on screens that implement swipe-to-refresh to ensure updated content is loaded.- Combine with a
wait
command if additional time is needed for the refreshed data to appear.
swipeNative
The swipeNative
command simulates a swipe gesture, allowing you to swipe either across the entire page or inside a specific element.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
comment |
String | ✅ | - | Description of the swipe action. |
direction |
String (up , down , left , right ) |
✅ | - | Direction of the swipe gesture. |
type |
String (element or page ) |
✅ | - | Whether to swipe the full page or a specific element. |
locator |
String | ❌ (Required if type="element" ) |
- | Locator for the UI element to swipe (only for element type). |
percent |
Integer (1–100) | ❌ | 70 |
Percent of the screen or element to swipe over. |
quantity |
Integer | ❌ | 1 |
Number of consecutive swipes to perform. |
condition |
Boolean Expression | ❌ | - | Condition to decide if this step should be executed. |
threshold |
Integer (ms) | ❌ | - | Maximum allowed execution time; step fails if exceeded. |
locatorStrategy |
String | ❌ | locatorId |
Custom locator strategy if needed (more info in Locators Guide). |
<swipeNative comment="Swipe an element to the right">
<element comment="Swipe right on element" locator="profile.card" direction="right" percent="70" quantity="1"/>
</swipeNative>
<swipeNative comment="Swipe the page to the left"> <page comment="Swipe left across the page" direction="left" percent="70" quantity="1"/> </swipeNative>
✅ Tip:
- Use
element
swipes for containers or carousels.- Use
page
swipes for navigating through screens.- Adjust
percent
for shorter or longer swipe gestures.
webView
The webView
command switches the context to a web view, allowing you to interact with web content inside a native app.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
comment |
String | ✅ | - | Description of the action to switch to the web view. |
condition |
Boolean Expression | ❌ | - | Condition to decide if this step should be executed. |
threshold |
Integer (ms) | ❌ | - | Maximum allowed execution time; step fails if exceeded. |
<webView comment="Switching to the webView"> <input comment="Input user email" locator="login.email" value="test@testlum.com"/> </webView>
✅ Tip:
Use this command when you need to interact with web content embedded inside a native app, like a hybrid mobile app with web views.
Explore different ways to run and useful information for native tests: