Many times while I was writing code in Coded UI Test, I end up with test execution flow and realize how the life cycle of test works, there are certain situations where my test connect with database, access some properties by fetching data from XML file and the same has to be released for next test module. Well if I had got a handle of Test Execution flow, then the whole process is even more simple and faster. I think I found it finally and here is how the Test execution flow actually works.
The flow will look like this.
- AssemblyInitialize
- ClassInitialize
- TestInitialize
- TestMethod
- TestCleanup
- ClassCleanup
- AssemblyCleanup
Here is how the code looks like
//Assembly Initialize is not used in this particular demonstration
[ClassInitialize]
public void AppInitialize()
{
}
[TestInitialize]
public
void DBInitialize()
{
}
[TestMethod]
public void executeTestCase()
{
}
[TestCleanup]
public void TestcaseCleanup()
{
}
[ClassCleanup]
public void ConnectionClose()
{
}
Thanks,
Karthik KK
For any query contact me @
Karthik@techgeek.co.in or leave your comment on blog!!!