Test Automation
January 21, 2021

Auto-Threading – your Smart Playback Partner

Our software projects are complex, and in turn, so is our test automation. We create and execute several tests and test suites in parallel, that comes with problems of its own.

During Test Automation execution, it is possible that your system gets overloaded due to too many parallel scripts or browser threads launched at the same time. This may lead to higher CPU Usage and the system may hang or crash.

This is a problem many test teams struggle with, thus having to constantly monitor test runs and manually re-execute tests that fail or hang the system.

The solution using Sahi Pro v9.0

Sahi Pro v9.0 has introduced the new concept of Automatic Thread Allocation or Auto-Threading

Sahi Pro’s Auto-threading capability smartly refrains your browser from launching if the CPU usage is more than a threshold configurable value. It allows to launch a browser only if enough CPU is available. It checks the CPU usage of the machine before launching each browser instance and allows it to launch only if enough CPU is available. This brings stability for your script execution.

Here are the 2 properties related to Auto-threading in Sahi Pro:

# Launches browser depending upon cpu usage
sahi.auto_thread.enabled=true

# Threshold cpu usage below which browser can be launched
sahi.threshold.cpu_usage=90

If Auto-threading is enabled, the maximum number of browsers opened will be equal to the count specified as “Thread” number during the Suite Playback in the Playback dialog.

Auto-threading is a smart playback option that helps bring stability and reliability to your test automation execution and provides you more control over your test execution.

Give it a try now!

Getting Started

Continue reading