Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I have a need to automate regression scenarios in the following environment:

  1. Application A process a case and dispose it to Application B.
  2. Application B wait for that case up to 10 minutes.
  3. Application B processes that case and disposes it back to Application A.
  4. Application A waits for that case up to 10 minutes.
  5. Application A process the case.

Both application requires logging. I have an access to the UI level only I am limited to the Webdriver and QTP

My biggest challenge is the time factor. How to create an automated scenario where there might be time gap up to 10 minutes ?

share|improve this question

2 Answers 2

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++)
    {
        if (browser.IsElementPresent(byLocator))
            return true;
        Thread.Sleep(1000);
    }
    return false;
}

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.

share|improve this answer

If you want to use QTP then in QTP you can use the wait property method with do..while loop and wait till the cases are disposed in either of the application with maximum wait time given.

Here you can write separate function and/or action which you can call to launch and login to application with checkpoint whether browser exist or not. This you can reuse with parameters in input.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.