Hybrid wait strategy for generated actions
TrueTest applies a hybrid wait strategy to generated web test cases to reduce timing-related failures in slower or less stable environments. The strategy combines action-specific wrapper methods, explicit transition waits, and configurable timeout variables so generated scripts remain readable while waiting for the right runtime conditions.
Understand the hybrid wait strategy​
Generated TrueTest scripts can fail intermittently when the application under test responds more slowly than the generated action sequence. For example, a page may still be loading, a control may not be clickable yet, or a new window may not be ready when the next generated step runs.
The hybrid wait strategy handles these cases in two ways:
- TrueTest uses
TrueTestScriptswrapper methods when the wait is intrinsic to the action. For example, a generated click action can wait for the target element to become clickable before the interaction runs. - TrueTest keeps explicit wait steps visible in generated scripts when the next state depends on the previous action. These transitions can include page navigation, modal opening, iframe entry, async refresh, and window switching.
This avoids adding the same wait before every generated action. It also replaces generator-owned fixed delays with waits that use shared GlobalVariable timeout values.
Review generated wait behavior​
TrueTest applies waits based on the generated action type.
Page and browser context actions
TrueTestScripts.navigate(...)callsWebUI.navigateToUrl(...), then waits for the page to load withWebUI.waitForPageLoad(GlobalVariable.waitForPageLoadTimeOut).TrueTestScripts.refresh()callsWebUI.refresh(), then waits for the page to load withWebUI.waitForPageLoad(GlobalVariable.waitForPageLoadTimeOut).TrueTestScripts.switchToNextWindow(),TrueTestScripts.switchToWindowIndex(...), andTrueTestScripts.switchToWindowTitle(...)wait for the target window context, switch windows, then wait for the page to load.
Element interaction actions
TrueTestScripts.click(...),TrueTestScripts.check(...), andTrueTestScripts.uncheck(...)wait for the target element to become clickable before interacting with it.TrueTestScripts.setText(...),TrueTestScripts.setEncryptedText(...), andTrueTestScripts.sendKeys(...)wait for the target input to be ready before entering text or sending keys.TrueTestScripts.uploadFile(...)waits for the target file input element to be present before uploading the file.
Selection and specialized control actions
TrueTestScripts.selectOption(...)andTrueTestScripts.selectOptionByValue(...)wait for the control to be ready before selection and preserve post-selection verification.TrueTestScripts.setTinyMCEContent(...)uses a global editor readiness timeout instead of a hardcoded value.TrueTestScripts.setSliderValue(...)uses slider readiness checks instead of a fixed delay.TrueTestScripts.dragAndDropByOffset(...)andTrueTestScripts.dragAndDropToTargetByDirection(...)wait for source and target readiness before drag-and-drop.
Direct generated actions
Some actions remain direct generated steps instead of wrapper methods:
WebUI.scrollToElement(...)remains direct. TrueTest emitsWebUI.waitForElementPresent(...)before scrolling only when the target may not exist yet.- Verification steps such as
WebUI.verifyElementVisible(...),WebUI.verifyElementNotVisible(...),WebUI.verifyElementText(...), andWebUI.verifyElementAttributeValue(...)remain direct. TrueTest uses wait-based verification variants or explicit waits only when the verified state is expected to settle asynchronously.
Tune wait timeouts​
The generated wrappers reference global variable timeout values. You can tune these values for slower or faster execution environments without editing every generated step.
- Open the generated project in Katalon Studio.
- Open the execution profile used by the generated test case.
- Locate the TrueTest wait timeout variables.
- Update the timeout values for your execution environment.
- Run the generated test case and adjust the values again if the application under test still needs more time for specific actions or transitions.
For more information about global variables and execution profiles, see Global variables and execution profile.
Timeout variables​
TrueTest can generate separate timeout variables for major wait categories:
GlobalVariable.waitForPageLoadTimeOut: waits for page load after navigation, refresh, or window switching.GlobalVariable.waitForElementClickableTimeOut: waits for clickable controls before click, check, and uncheck actions.GlobalVariable.waitForElementVisibleTimeOut: waits for visible elements when visibility is required before continuing.GlobalVariable.waitForElementPresentTimeOut: waits for elements to exist in the page before actions such as upload or conditional scroll waits.GlobalVariable.waitForElementNotVisibleTimeOut: waits for elements to disappear when a generated flow depends on that state.GlobalVariable.waitForSelectOptionTimeOut: waits for selection controls and post-selection verification.GlobalVariable.waitForEditorReadyTimeOut: waits for TinyMCE editor readiness.GlobalVariable.waitForSliderReadyTimeOut: waits for slider readiness before setting a slider value.GlobalVariable.waitForDragAndDropReadyTimeOut: waits for drag-and-drop source and target readiness.GlobalVariable.waitForWindowSwitchTimeOut: waits for the target window context before switching windows.
Use the timeout that matches the action family instead of increasing every timeout value at once. This keeps generated test execution predictable and helps you isolate which part of the application needs more time.
Limitations​
- The strategy does not redesign Smart Wait or replace all application-specific synchronization needs.
- Some UI patterns, such as non-native dropdowns, editor widgets, iframe-heavy screens, and asynchronous refreshes, may still require specialized handling.