这几乎是我开始进行自动化测试的原因,所以如果我不能让你清楚,我想道歉!使用Selenium和NUnit进行UI自动化测试测试执行顺序
因此,一两个星期阅读自动化的博客后,我决定用NUNIT与硒的webdriver的UI自动化。
我的应用是在开发3年后留存的企业级应用。这是一个项目和投资组合管理系统。
我有数百页,其中约50%执行CRUD操作。
,我决定为我的应用程序如下strucutre:
我使用的测试数据为JSON在下面的格式和这个数据retrive到我的视图模型:
[
{
"Name": "Finance",
"Description": "division with complete test data",
"Color": "#ff0000",
"ExpectedStatus": {
"WillBeAdded": true,
"WillBeDeleted": true,
"WillBeUpdated": true
},
"PerformableActions": {
"ShouldAdd": true,
"ShouldDelete": false,
"ShouldUpdate": true
}
},
{
"Name": "IT",
"Description": "IT projects",
"Color": "pink",
"ExpectedStatus": {
"WillBeAdded": true,
"WillBeDeleted": true,
"WillBeUpdated": true
},
"PerformableActions": {
"ShouldAdd": true,
"ShouldDelete": false,
"ShouldUpdate": true
}
},
{
"Name": "Business",
"Description": "division with name and color name",
"Color": "yellow",
"ExpectedStatus": {
"WillBeAdded": true,
"WillBeDeleted": true,
"WillBeUpdated": true
},
"PerformableActions": {
"ShouldAdd": true,
"ShouldDelete": false,
"ShouldUpdate": true
}
},
{
"Name": "",
"Description": "division without name and color name, should add white color",
"Color": "",
"ExpectedStatus": {
"WillBeAdded": true,
"WillBeDeleted": true,
"WillBeUpdated": true
},
"PerformableActions": {
"ShouldAdd": true,
"ShouldDelete": true,
"ShouldUpdate": true
}
},
{
"Name": "",
"Description": "without name and color name and will not be added",
"Color": "black",
"ExpectedStatus": {
"WillBeAdded": false,
"WillBeDeleted": false,
"WillBeUpdated": false
},
"PerformableActions": {
"ShouldAdd": true,
"ShouldDelete": false,
"ShouldUpdate": false
}
}
]
我这里使用两件事:
1. PerformableActions ie ie what我可以通过使用这个测试用例数据来执行操作。例如,shouldAdd表示应该为添加记录执行此TestCase,shouldDelete表示此TestCase是否应该运行以删除记录,同样应该运行UpdateUpdate。
2. ExpectedStatus即测试用例的预期结果是什么 WillBeAdded意思是将这个数据添加到网格中。同样的WillBeDeleted和WillBeUpdated工作。
问题:
1)我使用相同的测试数据为所有CUD操作,这样做的原因是,我要保持我的应用程序的CUD流。由于只需要测试用户界面,所以我只是假设创建,检索和删除将按顺序工作。
这是在CRUD操作情况下进行测试的正确方法吗?
2)想我要在我的项目运行所有测试,也可能是数百或数千,我将如何维持秩序,因为我能看到的唯一可能的方法是使用订购属性, NUNit。我该如何使用它,或者是否有任何替代方法来单独测试独立模块组和独立模块组?
感谢至少有人看着我的问题。非常感谢你!主要问题仍然是订购。我现在有超过20个CUD实体,如果我使用订单,我必须遵循1,2,3,4,当我订购超过9个订单时,列表更新为1,12,13,2,3 ,4等等。意味着它按字母顺序排列。我被困住了,现在发现它非常厌恶硒元素的使用。你能否给我提供一些演示,如果我的测试数量在几百,我如何分类我的测试,我需要用我的愿望来执行它们。我甚至可以使用包装来做到这一点。我处于可以接受任何事情的地步。 – Umar