Programs are great at waiting. If your using web driver you can easily add a wait clause like:
public static bool WaitFor(this IWebDriver browser, By byLocator, int maxWait = 5)
for (int i = 0; i < maxWait; i++)
Then wait for your element like:
driver.WaitFor(By.Id('expectedElementId', 600) // wait 600 seconds for the element to appear
This code is in C# but is easily adapted to any other language.
However are you sure you really have to wait? When you say "Process a case and dispose it to Application B", what does that mean? is it a post back you can capture between web servers? is it a file that's saved and then opened by app b?
The reason why I ask is that the exchange seems a great place for a mock or fake. Instead of application B waiting for application A's output, build the output postback or file directly then just give it to application B. You can then separate your concerns into separate tests.
Instead of the one test case, break it down.
- Application A processes a case and returns the expected results.
- Application B takes my previously captured results and processes it to another expected state.
- Application A accepts another expected result like what Application B returns and returns another expected result.
By doing your test this way you can also better isolate if anything goes wrong. If you try your test, which part broke? Application A? Application B? And it takes you 30 minutes to even tell if something is broken. By isolating your items and testing each application, you can tell App A fails to process the case or App B fails to respond correctly, or App A Fails to process App B output correctly and all without any waiting. That level of detail is much more valuable to a developer rather than it's all broke.