vendredi 6 novembre 2015

Coded UI Test issues with threads / performing repeated actions periodically

I'm automating tests in a system built in VB, so I can't get a lot of controls in this system with the "Coded UI Test Builder" tool. Said that, I built a method to took a screenshot and compare a region to verify if the system threw an error window (not really a window, I can't get this one with the tool either) and this function was called periodically in another thread, but I received that the exception:

Microsoft.VisualStudio.TestTools.UITest.Extension.UITestException: The Coded UI Test is running in Single Thread Apartment (STA) mode of COM. In this mode, all the playback calls should happen from the TestMethod thread only and UITestControl should not be shared across TestMethods.

Then I figured out that UI Test do not support multi-thread, and I was forced to call the function to verify the error after each interaction with the system (e.g. generate a report, verify error, close the report, verify error).

Probably the a better way to do that or a software design pattern, but I'm just beginning with automated tests and don't know what should I do to improve that test.

My questions is: is that a better way? What is it.

Aucun commentaire:

Enregistrer un commentaire