Skip to main content
Documentation|Best Practices – Web

QPilot Best Practices Guide — Web

Supported actions, reference examples, and do's & don'ts for browser testing

Supported Actions — Web

ActionCommonWeb 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

ActionDescriptionExample Step
CLICKLeft-clicks a button, link, or elementClick the Sign In button
HOVERMoves cursor over element to reveal menus or tooltipsHover over the Products menu item
INPUT_TEXTTypes text into an input fieldEnter john@example.com in the email field
CLEAR_TEXTClears existing content from a fieldClear the search input field
GET_TEXTCaptures the visible text of an elementGet the text of the total price field
WAITPauses for a set durationWait for 3 seconds
SELECT_OPTIONSelects a value from a native HTML dropdownSelect Singapore from the country dropdown
SWITCH_TABSwitches browser focus to another open tabSwitch to the second tab
SWITCH_IFRAMESwitches context into an embedded iframeSwitch to iframe 1
RESET_IFRAMEReturns focus to main document from an iframeReset iframe context
MOVE_SLIDERAdjusts a slider to a target valueMove the price filter slider to 1000
DRAG_DROPDrags an element and drops it on a targetDrag image block and drop into the banner section
SCREENSHOTCaptures a screenshot at that pointTake a screenshot of the current page
REFRESH_PAGERefreshes the current browser pageRefresh the page
APP_CONTROL_MAXIMIZEMaximises the browser windowMaximise the browser window
NAVIGATE_BACKNavigates browser history back one stepNavigate back
NAVIGATE_FORWARDNavigates browser history forward one stepNavigate forward
GET_PAGE_URLRetrieves the current browser URLGet the current page URL
GET_PAGE_TITLERetrieves the current page titleGet the current page title
IS_DISPLAYEDChecks if an element is visible in the viewportCheck if the success banner is displayed
IS_ENABLEDChecks if an element is interactableCheck if the Checkout button is enabled
ASSERTValidates an expected condition — fails on mismatchAssert the page heading says Welcome Back
IS_TEXT_PRESENTChecks if a text string is present on the pageValidate if Payment Successful is present

Web — Do's and Don'ts

DO's

#DoExample
1Be specific about the element — reference its visible label, placeholder, or positionClick the Submit button at the bottom of the registration form
2Paste multiple steps at once — QPilot processes bulk input and queues all steps sequentiallyPaste an entire login flow in one go
3Use HOVER before CLICK for navigation menus that only reveal sub-items on hoverHover over Services menu → Click the Consulting option
4Use SELECT_OPTION for native HTML dropdowns and CLICK for custom JS dropdownsSelect Monthly from the billing cycle dropdown
5Use test data variables with {{key}} syntax for any input that changes between runsEnter {{username}} in the username field
6Use SWITCH_TAB explicitly whenever an action opens a new browser tabClick the Open Preview button → Switch to the second tab
7Use SWITCH_IFRAME before interacting with elements inside an embedded iframeSwitch to payment iframe → Enter card details → Reset iframe
8Use ASSERT or IS_TEXT_PRESENT to validate outcomes at key checkpoints in the flowAssert the confirmation number is displayed
9Use GET_PAGE_URL or GET_PAGE_TITLE to assert navigation state after redirectsGet current page URL → Assert it contains /dashboard
10Use SCREENSHOT at critical flow checkpoints as a visual recordTake a screenshot of the order confirmation page
11Retrieve Frame InformationIdentify and obtain the list of available frames present on the page
12Switch to the Target FrameBefore performing any operation on an element inside a frame, the automation context must explicitly switch to the specific frame that contains the target element.
13Perform the Required ActionOnce the driver context is inside the correct frame, interact with the element (e.g., click, input text, retrieve attributes).
14Reset the Frame ContextAfter completing the action, the frame context must be reset (e.g., switch back to the default content).
15Switching to Another FrameIf 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'tInstead
1Don't use vague element descriptions❌ Click the link → ✅ Click the Forgot Password link below the login form
2Don't add unnecessary explicit waits — QPilot handles element readiness automaticallyOnly use WAIT when a genuine page load or animation delay exists
3Don't chain multiple actions into a single step❌ Enter email, click next and enter the password → Write each separately
4Don't use CLICK on native HTML select dropdowns — always use SELECT_OPTION❌ Click Monthly in the dropdown → ✅ Select Monthly from dropdown
5Don't forget RESET_IFRAME after completing interactions inside an iframeFailing to reset will cause subsequent steps to target the wrong context
6Don't forget SWITCH_TAB after an action that opens a new tabInteracting with new tab content without switching first applies actions to wrong tab
7Don't hardcode test data when it varies per run❌ Enter admin@company.com → ✅ Enter {{E1}} in the email field
8Don't use NAVIGATE_BACK as substitute for proper flow designPrefer 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

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

ModeUse WhenExample Step
Default (auto)Element loads within ~10 seconds; standard interactionsClick the Login button
Explicit waitA known fixed delay is expected (e.g., animation, transition)Wait for 3 seconds
Custom timeoutSlow page loads, dynamic content, or external API callsStep 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.

OperationDescriptionExample Step
Open new tabOpens 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 positionSwitches 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 nameSwitches to the tab matching the given name, regardless of its position in the tab order.Switch to Amazon tab
Close by nameCloses the tab with the specified name. Useful for cleaning up after completing work in a specific tab.Close Amazon tab
Close by positionCloses the tab at the specified index position. Use when you want to manage resources and focus on a single page.Close 2nd tab
info

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.

CommandDescriptionExample Step
SCROLL_UPScrolls the screen upward. Supported on both Android and iOS.Scroll up to the top of the page
SCROLL_DOWNScrolls the screen downward. Supported on both Android and iOS.Scroll down
Scroll until element visibleScrolls 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 pixelsScrolls by a precise pixel amount. Use for fine-grained control of the viewport position.Scroll by 100px
Scroll by percentageScrolls 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 / bottomJumps the viewport to the very top or very bottom of the page in a single step.Scroll to the bottom
Scroll multiple timesRepeats 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?