Kill a transaction if it takes longer than 5 minutes

Hi All,

I am automating a process in SAP application. In some cases, the SAP application hangs and the BOT just gets stuck in that step. The Transaction item is “In Progress” state for 19 hours when the entire process should only take 1 minute per transaction. We searched the forum and found that we could use the “Timeout” property in the “Invoke Workflow File” activity for 3 minutes, but that is not working. Does anyone have any other suggestions?

I want any transaction to run only for a maximum of 3 minutes. If the transaction if still “In Progress” after 3 minutes, the BOT should move on to the next transaction.

Thanks in Advance,
Jegan Chakkravarthy

Hi @Yhtravarkkhc_Nagej

Based on the delay activity please do use it and do a kill process activity

Ashwin S

The problem here is that the BOT will not move to the delay activity at all if it is stuck.

The below picture should give you an idea of the issue.

So a delay would not work because, let us say a click activity is not yet completed.

Hi @Yhtravarkkhc_Nagej

Try element exists for each activity and use Click activity and use element exists and then use get text

Ashwin S

We have 127 click activities in the process. In many cases, the element is an underlay and the element is always available. So element exists does not always give the expected result. We have tried the common approaches and none of them worked.

Hi @Yhtravarkkhc_Nagej
It all depends on the Selector we redefine it in UIExplorer

Ashwin S

Yes Ashwin, We have tried that, but that too does not end the transaction.
We need a way to kill a transaction and move to the next transaction in the queue if a particular time has elapsed.

You can use “Try catch” activity
In “Try” section - place “Invoke workflow file” linked with your sequence in file
In “Catches” section - select exceptions
In “Finally” - “kill process”

Using a Try-Catch will only work if there is an Exception, but my situation does not cause any Exception. So I don’t think this option will help me.

for getText activity - try “FindElementException” & “NullReferenceException”

@Yhtravarkkhc_Nagej Even I am facing the same issue where bot is getting stuck whenever SAP is getting stuck. It is not raising system exception. Were you able to resolve this issue ?

Are you using the ReFramework?

If any activity fails it should throw an exception, gets caught in the Process State as a SystemException and the Queue Item in Orchestrator gets marked as Failed with an Application Exception in the SetTransactionStatus workflow. You can even add details of the exception to the transaction.

Then, in the framework you should close the application and retry opening the application and continue processing transactions. You can even set the Orchestrator Queue to retry transaction items.


Hello Mayank,
please take a look at this thread, here you can find the solution to wait a definite time or infinity to the end of an SAP action. As an asynchronous task this should also allow to terminate the SAP GUI for Windows.
Best regards

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.