Hi,
i’m using the web automation for downloading the report.Loading time is more than 5mins.if timetaken greaterthan 4,then bot has to halt the workflow.
Hello @chandrakala.productanalys
-
Assign activity:
startTime = DateTime.Now -
Retry Scope activity:
Set the Number of Retries property to an appropriate value (e.g., 5 retries).Inside the Retry Scope:
a. Web automation activities to download the report.b. If activities:
Condition: DateTime.Now.Subtract(startTime).TotalMinutes > 4
Actions:
- Log Message: “Download taking too long. Halting workflow.”
- Terminate Workflow activity
Thanks & Cheers!!!
- Retry Scope Activity:
- Drag and drop a “Retry Scope” activity onto your workflow.
- Set the
MaxRetries
property to control how many times the operation should be retried.
- Inside the Retry Scope Activity:
- Place your web automation activities, such as clicking buttons, navigating, and downloading the report.
- Add a Timeout for Each Activity:
- For each activity within the Retry Scope, set the
TimeoutMS
property to a value that makes sense for that specific activity. This value represents the maximum time that the activity is allowed to execute before UiPath considers it failed. - For example, if you have a “Click” activity, set its
TimeoutMS
property to 240000 for a 4-minute timeout.
- Handling Timeout Exception:
- After the Retry Scope, use a “Try Catch” activity.
- Inside the “Try” block, place the activities that are within the Retry Scope.
- In the “Catch” block, add a “Log Message” activity to log a message such as “Loading time exceeded the specified threshold. Halting workflow.”
- Add additional activities as needed to halt the workflow. For example, you can use a “Throw” activity to throw a custom exception or perform other actions to stop the workflow.
Create a variable of datetime say starttime and then assign DateTime.Now
before starting download or load
after the download or load use a if codnition and check if the difference crossed 3 minutes
(DateTime.Now - StartTime).ToTalMinutes > 3
on then side use terminate workflow and on else side continue the process and do nothing
cheers
cheers
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.