How should I write the test cases to check the Uniqueness of entries in a "Employee_ID" field? Based upon the above entry further funtionality like "ADD","UPDATE",etc. can be performed else on duplication, an Error Message will be displayed.
I think that there should be two test cases:
1. Entry of any random number"123" in Employee-ID field by User would lead to Display of Error Message"Invalid/Incorrect ID".
2. Entry of A valid Employee-ID by User on second attempt would further enable him to do other functions like "ADD","UPDATE",etc.
Is above logic correct for writting Test Cases?
But here some logic for checking the validity/correctness of Employee_ID from Database should be applied.
Thanks in advance.
IMHO no you can't. A test case is generally independent of the "white-box" aspects unless your test domain requires this type of test.
Just because an SQL query gives the expected results is no guarantee that the AUT will give the same results (although it may be useful inasmuch as you know the database can provide the right answer if it's asked the right question...)
Hi vikas , i am giving you my share of help
Testing on front end-
1)Enter a employee number, click on the submit button, the employee shall be accepted
Negative test case
1)Enter a existing employee number, click on the submit button , the system shall prompt with a error message thats it.
and vikas from the front end you cant check the uniqueness,you can only check how the application performs.
ofcourse you can check the database by query.but writing the test case for that - ask your PM/PL na how he wants it.