QPilot Best Practices Guide — Web
Supported actions, reference examples, and do's & don'ts for browser testing
Supported Actions — Web
| Action | Common | Web Only |
|---|---|---|
| CLICK | ✔ | ✔ |
| HOVER | ✔ | |
| INPUT_TEXT | ✔ | ✔ |
| CLEAR_TEXT | ✔ | ✔ |
| GET_TEXT | ✔ | ✔ |
| WAIT | ✔ | ✔ |
| SELECT_OPTION | ✔ | |
| SWITCH_TAB | ✔ | |
| SWITCH_IFRAME | ✔ | |
| RESET_IFRAME | ✔ | |
| DRAG_DROP | ✔ | ✔ |
| SCREENSHOT | ✔ | ✔ |
| REFRESH_PAGE | ✔ | |
| APP_CONTROL_MAXIMIZE | ✔ | |
| NAVIGATE_BACK | ✔ | |
| NAVIGATE_FORWARD | ✔ | |
| GET_PAGE_URL | ✔ | |
| GET_PAGE_TITLE | ✔ | |
| IS_DISPLAYED | ✔ | ✔ |
| ASSERT | ✔ | ✔ |
| IS_ENABLED | ✔ | ✔ |
| IS_TEXT_PRESENT | ✔ | ✔ |
| SWITCH_FRAME | ✔ | |
| GET_FRAMES | ✔ | |
| KEY_PRESS_ENTER | ✔ | ✔ |
| KEY_PRESS_TAB | ✔ | ✔ |
| KEY_PRESS_BACKSPACE | ✔ | ✔ |
| KEY_PRESS_DELETE | ✔ | ✔ |
| KEY_PRESS_SPACE | ✔ | ✔ |
Web Action Reference & Examples
| Action | Description | Example Step |
|---|---|---|
| CLICK | Left-clicks a button, link, or element | Click the Sign In button |
| HOVER | Moves cursor over element to reveal menus or tooltips | Hover over the Products menu item |
| INPUT_TEXT | Types text into an input field | Enter john@example.com in the email field |
| CLEAR_TEXT | Clears existing content from a field | Clear the search input field |
| GET_TEXT | Captures the visible text of an element | Get the text of the total price field |
| WAIT | Pauses for a set duration | Wait for 3 seconds |
| SELECT_OPTION | Selects a value from a native HTML dropdown | Select Singapore from the country dropdown |
| SWITCH_TAB | Switches browser focus to another open tab | Switch to the second tab |
| SWITCH_IFRAME | Switches context into an embedded iframe | Switch to iframe 1 |
| RESET_IFRAME | Returns focus to main document from an iframe | Reset iframe context |
| MOVE_SLIDER | Adjusts a slider to a target value | Move the price filter slider to 1000 |
| DRAG_DROP | Drags an element and drops it on a target | Drag image block and drop into the banner section |
| SCREENSHOT | Captures a screenshot at that point | Take a screenshot of the current page |
| REFRESH_PAGE | Refreshes the current browser page | Refresh the page |
| APP_CONTROL_MAXIMIZE | Maximises the browser window | Maximise the browser window |
| NAVIGATE_BACK | Navigates browser history back one step | Navigate back |
| NAVIGATE_FORWARD | Navigates browser history forward one step | Navigate forward |
| GET_PAGE_URL | Retrieves the current browser URL | Get the current page URL |
| GET_PAGE_TITLE | Retrieves the current page title | Get the current page title |
| IS_DISPLAYED | Checks if an element is visible in the viewport | Check if the success banner is displayed |
| IS_ENABLED | Checks if an element is interactable | Check if the Checkout button is enabled |
| ASSERT | Validates an expected condition — fails on mismatch | Assert the page heading says Welcome Back |
| IS_TEXT_PRESENT | Checks if a text string is present on the page | Validate if Payment Successful is present |
Web — Do's and Don'ts
DO's
| # | Do | Example |
|---|---|---|
| 1 | Be specific about the element — reference its visible label, placeholder, or position | Click the Submit button at the bottom of the registration form |
| 2 | Paste multiple steps at once — QPilot processes bulk input and queues all steps sequentially | Paste an entire login flow in one go |
| 3 | Use HOVER before CLICK for navigation menus that only reveal sub-items on hover | Hover over Services menu → Click the Consulting option |
| 4 | Use SELECT_OPTION for native HTML dropdowns and CLICK for custom JS dropdowns | Select Monthly from the billing cycle dropdown |
| 5 | Use test data variables with {{key}} syntax for any input that changes between runs | Enter {{username}} in the username field |
| 6 | Use SWITCH_TAB explicitly whenever an action opens a new browser tab | Click the Open Preview button → Switch to the second tab |
| 7 | Use SWITCH_IFRAME before interacting with elements inside an embedded iframe | Switch to payment iframe → Enter card details → Reset iframe |
| 8 | Use ASSERT or IS_TEXT_PRESENT to validate outcomes at key checkpoints in the flow | Assert the confirmation number is displayed |
| 9 | Use GET_PAGE_URL or GET_PAGE_TITLE to assert navigation state after redirects | Get current page URL → Assert it contains /dashboard |
| 10 | Use SCREENSHOT at critical flow checkpoints as a visual record | Take a screenshot of the order confirmation page |
| 11 | Retrieve Frame Information | Identify and obtain the list of available frames present on the page |
| 12 | Switch to the Target Frame | Before performing any operation on an element inside a frame, the automation context must explicitly switch to the specific frame that contains the target element. |
| 13 | Perform the Required Action | Once the driver context is inside the correct frame, interact with the element (e.g., click, input text, retrieve attributes). |
| 14 | Reset the Frame Context | After completing the action, the frame context must be reset (e.g., switch back to the default content). |
| 15 | Switching to Another Frame | If another frame interaction is required, the automation must first switch back to the default context and then switch to the new target frame. Attempting to switch directly from one frame to another without resetting the context may lead to execution failures. |
DON'Ts
| # | Don't | Instead |
|---|---|---|
| 1 | Don't use vague element descriptions | ❌ Click the link → ✅ Click the Forgot Password link below the login form |
| 2 | Don't add unnecessary explicit waits — QPilot handles element readiness automatically | Only use WAIT when a genuine page load or animation delay exists |
| 3 | Don't chain multiple actions into a single step | ❌ Enter email, click next and enter the password → Write each separately |
| 4 | Don't use CLICK on native HTML select dropdowns — always use SELECT_OPTION | ❌ Click Monthly in the dropdown → ✅ Select Monthly from dropdown |
| 5 | Don't forget RESET_IFRAME after completing interactions inside an iframe | Failing to reset will cause subsequent steps to target the wrong context |
| 6 | Don't forget SWITCH_TAB after an action that opens a new tab | Interacting with new tab content without switching first applies actions to wrong tab |
| 7 | Don't hardcode test data when it varies per run | ❌ Enter admin@company.com → ✅ Enter {{E1}} in the email field |
| 8 | Don't use NAVIGATE_BACK as substitute for proper flow design | Prefer explicitly navigating to the target page instead |
Waits & Timeouts
QPilot automatically waits up to 15 seconds for any element to become interactable before executing an action. This built-in wait covers most scenarios without requiring any explicit instruction. For situations where a longer or more precise delay is needed, QPilot supports two additional wait modes.
Explicit Wait
Use a plain-language instruction to pause execution for a fixed duration. This is useful when a known delay exists — for example, after a form submission or before a transition completes. Example: Wait for 5 seconds
Custom Step Timeout (Recommended)
For slow-loading pages, dynamic content, or external API calls, set a custom timeout directly on the step. This overrides the default 10-second limit for that specific step only and can be set up to 300 seconds. To set a custom timeout: click the step menu → select Step Timeout → enter the required value (in seconds).
When to use each mode
| Mode | Use When | Example Step |
|---|---|---|
| Default (auto) | Element loads within ~10 seconds; standard interactions | Click the Login button |
| Explicit wait | A known fixed delay is expected (e.g., animation, transition) | Wait for 3 seconds |
| Custom timeout | Slow page loads, dynamic content, or external API calls | Step menu → Step Timeout → set 30 seconds |
Tab Management
QPilot supports multi-tab test flows using plain-language instructions. You can open new tabs, switch between them by name or position, and close them when no longer needed — all without writing any code.
| Operation | Description | Example Step |
|---|---|---|
| Open new tab | Opens the specified URL in a new browser tab. After opening, you must explicitly switch context to the new tab before interacting with it. | Open amazon.com in a new tab |
| Switch by position | Switches focus to the tab at the given index. Tab index starts at 1 in the order they were opened. | Switch to 2nd tab |
| Switch by name | Switches to the tab matching the given name, regardless of its position in the tab order. | Switch to Amazon tab |
| Close by name | Closes the tab with the specified name. Useful for cleaning up after completing work in a specific tab. | Close Amazon tab |
| Close by position | Closes the tab at the specified index position. Use when you want to manage resources and focus on a single page. | Close 2nd tab |
Always switch context after opening a new tab
Opening a new tab does not automatically move test focus to it. You must explicitly add a switch step immediately after — for example, Switch to Amazon tab — otherwise all subsequent actions will continue executing in the original tab.
Scrolling
QPilot supports a range of scroll commands for both fixed and dynamic pages. Use SCROLL_UP and SCROLL_DOWN for standard mobile scrolling. For web-based flows requiring precise or relative scrolling, the following commands are available.
| Command | Description | Example Step |
|---|---|---|
| SCROLL_UP | Scrolls the screen upward. Supported on both Android and iOS. | Scroll up to the top of the page |
| SCROLL_DOWN | Scrolls the screen downward. Supported on both Android and iOS. | Scroll down |
| Scroll until element visible | Scrolls until the specified element appears in the viewport. Use for elements that are initially off-screen. (Web only) | Scroll until the Submit button is visible |
| Scroll by pixels | Scrolls by a precise pixel amount. Use for fine-grained control of the viewport position. | Scroll by 100px |
| Scroll by percentage | Scrolls by a percentage of the current page height. Useful for relative scrolling in dynamic or variable-length pages. | Scroll by 20 percent |
| Scroll to top / bottom | Jumps the viewport to the very top or very bottom of the page in a single step. | Scroll to the bottom |
| Scroll multiple times | Repeats the scroll action a specified number of times. Helpful for infinite scroll pages or loading dynamic content progressively. | Scroll down 3 times |
Did this page help you?