{"id":28729,"date":"2025-07-28T07:14:25","date_gmt":"2025-07-28T11:14:25","guid":{"rendered":"https:\/\/www.h2kinfosys.com\/blog\/?p=28729"},"modified":"2025-07-28T07:15:42","modified_gmt":"2025-07-28T11:15:42","slug":"how-waiton-and-tbox-wait-improve-test-stability-with-timeout-settings","status":"publish","type":"post","link":"https:\/\/www.h2kinfosys.com\/blog\/how-waiton-and-tbox-wait-improve-test-stability-with-timeout-settings\/","title":{"rendered":"How WaitOn and TBOX Wait Improve Test Stability with Timeout Settings"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>Introduction:&nbsp;<\/strong><\/h2>\n\n\n\n<p>Stability is the key to achieving reliable and effective results in test automation. Automated tests often break due to unexpected delays in UI rendering, dynamic content loading, or fluctuating network responses. These inconsistencies can lead to false negatives, reduced trust in test results, and costly debugging sessions. This is where intelligent wait strategies come into play.<\/p>\n\n\n\n<p>In TOSCA Automation, mastering the concepts of WaitOn and TBOX Wait is vital for achieving reliable, robust, and efficient test executions. Whether you&#8217;re preparing for <a href=\"https:\/\/www.h2kinfosys.com\/courses\/tosca-automation-tool-training-and-certification-program\/\">TOSCA Certification Online<\/a>, enrolled in TOSCA Training Online, or enhancing your skills through a TOSCA Automation Course Online, understanding wait mechanisms is non-negotiable.<\/p>\n\n\n\n<p>This guide will walk you through the key concepts of static and dynamic waits, especially TBOX Wait and WaitOn, and show how they directly contribute to test stability via timeout management.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Understanding Waits: Dynamic vs Static<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Static Waits: Fixed Delays<\/strong><\/h3>\n\n\n\n<p>Static waits use a pre-set pause before continuing to the next step. In TOSCA, these include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>TBOX Wait<\/strong>: A fixed duration set explicitly in milliseconds.<br><\/li>\n\n\n\n<li><strong>WaitBefore<\/strong> and <strong>WaitAfter<\/strong>: Steering parameters used at the module attribute level or module level to introduce delays before or after a test action.<br><\/li>\n<\/ul>\n\n\n\n<p>These are useful in scenarios where UI load times are consistent and predictable but can lead to inefficiencies if overused.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Dynamic Waits: Condition-Based Pauses<\/strong><\/h3>\n\n\n\n<p>Dynamic waits, unlike static waits, pause the test only until a specific condition is met or a timeout limit is reached. In TOSCA, this is implemented using the WaitOn action mode.<\/p>\n\n\n\n<p>Rather than halting for a fixed time, this method checks the control&#8217;s state or value and proceeds as soon as the expected condition is satisfied, enhancing performance and stability.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>TBOX Wait: Static Synchronization Simplified<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What Is TBOX Wait?<\/strong><\/h3>\n\n\n\n<p><strong>TBOX Wait<\/strong> allows testers to halt the test execution for a fixed number of milliseconds. It\u2019s useful for inserting deliberate pauses where automation interacts with slow-loading components.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<p>Add TBOX Wait for 3000 milliseconds before clicking \u201cSubmit\u201d.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>When to Use It<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Interacting with static-heavy UI elements.<br><\/li>\n\n\n\n<li>Allowing transitions or animations to complete.<br><\/li>\n\n\n\n<li>Temporarily halting execution where dynamic waits are not feasible.<br><\/li>\n<\/ul>\n\n\n\n<p>However, overusing this feature can significantly slow down test execution.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>WaitBefore and WaitAfter: Fine-Tuning Static Waits<\/strong><\/h2>\n\n\n\n<p>These are module-level steering parameters used to add delays around actions:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>WaitBefore<\/strong>: Waits before an action begins.<br><\/li>\n\n\n\n<li><strong>WaitAfter<\/strong>: Waits after the action completes.<br><br><img fetchpriority=\"high\" decoding=\"async\" width=\"666\" height=\"248\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXcLWO1TNa8M4wdA6PWsxHc9mX-nIac61WrpHoX_1v2cWFPRPpuDNfZzpkvgpuzs3RBwvC8ftLsz5u81rCNAlcH-Q0pG7dItwHHgad8_VO0e_eFrZTyxOsVpPoiF3cJoYPUJyI_a?key=7PBDmPdW4ip_1BHPVU6OhQ\" alt=\"\" title=\"\"><br><\/li>\n<\/ul>\n\n\n\n<p>Both are especially useful in handling short transitions or intermediate processes like loading spinners or pop-ups.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>WaitOn: Smarter, Dynamic Synchronization<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What Is It?<\/strong><\/h3>\n\n\n\n<p>The <strong>WaitOn<\/strong> action mode is TOSCA\u2019s built-in feature for dynamic waiting. Rather than relying on time-based halts, it watches the state or value of a control and proceeds once the condition is met or a defined timeout period elapses.<\/p>\n\n\n\n<p>This reduces flakiness and enhances script performance.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>How to Implement<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In the TestCase, select the control.<br><\/li>\n\n\n\n<li>Change the ActionMode to WaitOn.<br><\/li>\n\n\n\n<li>Define a verification condition like Enabled, Exists, or a specific Value.<br><br><img decoding=\"async\" width=\"666\" height=\"267\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXcKWbg7qxnYiN5lFCG254y0ZevLa5JI1b4SIC0p_ldael5coVlR-h0B4lIVdWj92yE-TJiHFMni8jTba2Abm6tIE7enp9oC6TYCPtrmtoL0OyrKkJcPPHJXQlXiIFU8_yqg-MhPHw?key=7PBDmPdW4ip_1BHPVU6OhQ\" alt=\"\" title=\"\"><br><\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Example Scenario<\/strong><\/h3>\n\n\n\n<p>Website:<br><a href=\"https:\/\/obstaclecourse.tricentis.com\/Obstacles\/33678\" rel=\"nofollow noopener\" target=\"_blank\">https:\/\/obstaclecourse.tricentis.com\/Obstacles\/33678<\/a><\/p>\n\n\n\n<p><strong>Steps<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Click <strong>Calculate<\/strong>.<br><\/li>\n\n\n\n<li>Use <strong>WaitOn<\/strong> to wait until the <strong>Send<\/strong> button is <strong>enabled<\/strong>.<br><\/li>\n\n\n\n<li>Click <strong>Send<\/strong>.<br><br><img decoding=\"async\" width=\"666\" height=\"188\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXd7z6gFxf9j7EsrHSI9aqN-6QOx7rogeTZAEjfkJMEW9gGpri1pOiCddnPnp1YEB_0pyTme6c6sFUNaiqfKWrsxZvSBV6qNHydShvLOsQkyevHyL5VQlPGO3Z8-VcAED_PfZeQ4?key=7PBDmPdW4ip_1BHPVU6OhQ\" alt=\"\" title=\"\"><br><\/li>\n<\/ul>\n\n\n\n<p>This ensures the action is taken only when the UI is ready, preventing premature clicks or failures.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Timeout Settings in TOSCA<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>synchronizationTimeout<\/strong><\/h3>\n\n\n\n<p>This is a global timeout setting determining how long TOSCA should wait for a control to appear or respond.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Default<\/strong>: 20000 ms (20 seconds)<br><\/li>\n\n\n\n<li><strong>Location<\/strong>: Settings \u2192 Project \u2192 TBOX<br><\/li>\n<\/ul>\n\n\n\n<p>If this time passes without the control becoming accessible, a sync error is raised.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>synchronizationTimeoutDuringWaitOn<\/strong><\/h3>\n\n\n\n<p>This is a dedicated timeout setting for the <strong>WaitOn<\/strong> mechanism.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Purpose<\/strong>: Controls how long TOSCA should wait for a control\u2019s condition during a WaitOn action.<br><\/li>\n\n\n\n<li><strong>Adjustable<\/strong>: Yes, based on project complexity or application responsiveness.<br><br><strong><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXfaE6H0ezycT4riYDSrW80FMXd3gEfU7OrV0QDYe--AyhrBuU_wqyskkIgiZ7KkRRof-1SzZ8hHUiaIa0YNoeLLOY2v7nJmrNsdP7DTZ47cFvxUBBSTSry4tBTC09_qdwEWYVhO?key=7PBDmPdW4ip_1BHPVU6OhQ\" style=\"\" alt=\"WaitOn \" title=\"\"><\/strong><br><\/li>\n<\/ul>\n\n\n\n<p>This allows testers to fine-tune the wait mechanism for different environments or app behaviors.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Why WaitOn Enhances Test Stability<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Condition-Based Waiting<\/strong><\/h3>\n\n\n\n<p>WaitOn relies on control states like Enabled, Exists, or Visible, ensuring synchronization is condition-driven rather than time-based.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Reduces Flaky Tests<\/strong><\/h3>\n\n\n\n<p>With conditional logic, WaitOn minimizes false negatives that stem from trying to interact with elements that aren&#8217;t ready.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Performance Gains<\/strong><\/h3>\n\n\n\n<p>Since it only waits as long as needed, WaitOn avoids unnecessary delays, making your test runs faster and more efficient.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Best Practices for WaitOn and TBOX Wait<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Prefer WaitOn Over Static Waits<\/strong><\/h3>\n\n\n\n<p>Use WaitOn wherever synchronization depends on control availability or state. It&#8217;s more adaptive to real-world application behavior.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Use TBOX Wait Sparingly<\/strong><\/h3>\n\n\n\n<p>Limit its use to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>External API latency.<br><\/li>\n\n\n\n<li>Non-interactive loading delays.<br><\/li>\n\n\n\n<li>Controlled environments with consistent timing.<br><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Adjust Timeout Settings When Needed<\/strong><\/h3>\n\n\n\n<p>If a control intermittently fails to appear within the default sync time:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Increase synchronizationTimeout.<br><\/li>\n\n\n\n<li>Adjust synchronizationTimeoutDuringWaitOn.<br><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Validate After Waiting<\/strong><\/h3>\n\n\n\n<p>Always follow a WaitOn step with a verification to confirm the control is indeed in the desired state.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Example: Obstacle Course in Action<\/strong><\/h2>\n\n\n\n<p>Navigate to:<br>https:\/\/obstaclecourse.tricentis.com\/Obstacles\/List<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Use Case:<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Click <strong>Calculate<\/strong><strong><br><\/strong><\/li>\n\n\n\n<li>Add a WaitOn step to monitor the <strong>Send<\/strong> button until it becomes enabled<br><\/li>\n\n\n\n<li>Proceed with <strong>Click Send<\/strong><strong><br><\/strong><\/li>\n<\/ul>\n\n\n\n<p>By using WaitOn, the test ensures the Send button is ready before interacting, reducing the chance of test failure.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Fixing Common Synchronization Errors<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Problem: Control Not Found<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Error<\/strong>: SynchronizationTimeout Error<br><\/li>\n\n\n\n<li><strong>Fix<\/strong>: Increase synchronizationTimeout or apply a dynamic WaitOn with more realistic expectations.<br><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Problem: False Failures<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Error<\/strong>: UI not ready when test proceeds<br><\/li>\n\n\n\n<li><strong>Fix<\/strong>: Add a WaitOn to monitor the control\u2019s state.<br><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Problem: Test Is Too Slow<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Cause<\/strong>: Excessive use of static TBOX Wait<br><\/li>\n\n\n\n<li><strong>Fix<\/strong>: Replace with conditional WaitOn logic where appropriate.<br><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Expert Tips to Optimize Wait Strategies<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use <strong>WaitBefore\/WaitAfter<\/strong> at the module level for micro-adjustments.<br><\/li>\n\n\n\n<li>Add <strong>WaitOn<\/strong> when testing dynamic web content or SPAs (Single Page Applications).<br><\/li>\n\n\n\n<li>Adjust default timeout values project-wide to suit your test environment.<br><\/li>\n\n\n\n<li>Document your wait logic for each test step for maintainability.<br><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Summary of Key Points<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>TBOX Wait, WaitBefore, and WaitAfter are static waits ideal for fixed delays.<br><\/li>\n\n\n\n<li>WaitOn is a dynamic mechanism that waits based on control state or value.<br><\/li>\n\n\n\n<li>Use synchronizationTimeout and synchronizationTimeoutDuringWaitOn to manage global and WaitOn-specific timeouts.<br><\/li>\n\n\n\n<li>Real-world application behavior often favors WaitOn for stable, efficient testing.<br><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Final Thoughts&nbsp;<\/strong><\/h2>\n\n\n\n<p>Mastering WaitOn and TBOX Wait isn\u2019t just about handling delays it\u2019s about creating intelligent, stable, and faster automation. Whether you&#8217;re enrolled in a <a href=\"https:\/\/www.h2kinfosys.com\/courses\/tosca-automation-tool-training-and-certification-program\/\">TOSCA Automation Course Online<\/a>, pursuing TOSCA Certification Online, or advancing through TOSCA Training Online, leveraging these tools effectively allows you to elevate your testing practices and enhance the robustness of your scripts.<\/p>\n\n\n\n<p><strong>Take your test automation to the next levels tart optimizing wait strategies today!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction:&nbsp; Stability is the key to achieving reliable and effective results in test automation. Automated tests often break due to unexpected delays in UI rendering, dynamic content loading, or fluctuating network responses. These inconsistencies can lead to false negatives, reduced trust in test results, and costly debugging sessions. This is where intelligent wait strategies come [&hellip;]<\/p>\n","protected":false},"author":18,"featured_media":28736,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1994],"tags":[2183,2184,2182],"class_list":["post-28729","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tosca-automation","tag-tbox-wait-settings","tag-test-stability-techniques","tag-waiton-tosca-automation"],"_links":{"self":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/28729","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/comments?post=28729"}],"version-history":[{"count":0,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/28729\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/media\/28736"}],"wp:attachment":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/media?parent=28729"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/categories?post=28729"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/tags?post=28729"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}