UI Automation Checking between two applications



  • 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 ?



  • 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.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2