Frequently, we have to repeat a test with different data values. This ‘data-driving’ is made very easy in Coded UI Test. In the Tutorial, we created a Coded UI Test to verify the addition of two numbers in the calculator. Let us now see how we can convert it into a data-driven test.
Hashtable ht = CUITe.CUITe_DataManager.GetDataRow(type, "XMLFile1.xml", "tc2"); Assert.AreEqual("test", ht["test"]); Assert.AreEqual("Kondapur, Hyderabad", ht["address"]); Assert.AreEqual("Suresh", ht["firstname"]); Assert.AreEqual("Balasubramanian", ht["lastname"]); Assert.AreEqual("04/19/1973", ht["dob"]); Assert.AreEqual("37", ht["age"]); Assert.AreEqual("Indian", ht["nationality"]);
http://blogs.msdn.com/b/mathew_aniyan/archive/2009/03/17/data-driving-coded-ui-tests.aspx
http://msdn.microsoft.com/en-us/library/ee624082.aspx
Hashtable ht = CUITe.CUITe_DataManager.GetDataRow(type, "XMLFile1.xml", "tc2"); Assert.AreEqual("test", ht["test"]); Assert.AreEqual("Kondapur, Hyderabad", ht["address"]); Assert.AreEqual("Suresh", ht["firstname"]); Assert.AreEqual("Balasubramanian", ht["lastname"]); Assert.AreEqual("04/19/1973", ht["dob"]); Assert.AreEqual("37", ht["age"]); Assert.AreEqual("Indian", ht["nationality"]);
http://blogs.msdn.com/b/mathew_aniyan/archive/2009/03/17/data-driving-coded-ui-tests.aspx
http://msdn.microsoft.com/en-us/library/ee624082.aspx
Комментариев нет:
Отправить комментарий