這幾乎是我開始進行自動化測試的原因,所以如果我不能讓你清楚,我想道歉!使用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