Reputation: 11
While performing a test Ranorex takes multiple attempts to find demanded item, withing a search timeout. I need to take control on the interval between these attempts.
I've checked all of the project settings, but didn't find anything related. Is there any way to edit this interval?
Upvotes: 1
Views: 72
Reputation: 514
In Ranorex, the interval between search attempts within the specified search timeout is controlled by the Search Timeout and Search Retry Interval settings. However, the Search Retry Interval itself is not exposed directly in the project settings. Instead, you can configure it programmatically.
You can configure retry intervals programmatically using Ranorex's Retry class in your code. Here's an example:
// Set the retry interval to 500ms (default is 50ms)
Ranorex.Core.Retry.Interval = 500; // Interval in milliseconds
// Example of finding an element
var repoItem = repo.YourApplication.YourElement;
if (repoItem.SelfInfo.Exists(5000)) // 5000ms timeout
{
Report.Info("Element found!");
}
else
{
Report.Warn("Element not found within the timeout period.");
}
The Retry.Interval property defines the interval between search attempts, allowing you to control it globally for your tests.
Upvotes: 0
Reputation: 31
In Ranorex, you can adjust the frequency of retrying to find an item by changing the "Retry Interval" in the vault settings. This parameter controls the timeout between each retry during the search timeout.
Upvotes: 0