Test Case Preparation - testing

I am a newbie to testing field. I know that test cases are the conditions to fulfil any client requirements i.e. the test conditions we need to fulfil the requirements.
I need some idea how to formally write a test case. Can anyone give me any idea of writing the test cases.
Assume an example of login page. i want to write the test case for a login screen. Please provide a pattern to do so.
Any other example is also favourable.

Hey.
BDD approach is also nice way to express behavior. Simple Given-When-Then lets you structure your idea.
For example:
Scenario: Login as Admin
Given: Login Page is loaded
And loginInput field is present
And loginPassword secure filed is present
And locinSubmit button is present
When: User puts adminLoginName into loginName field
And User puts adminLoginPassword in loginPassword secure field
And User clicks loginSubmit button
Then: LoginPage is closed
And MainPage is loaded
And AdminPanel is visible

Basically, in order to create tests and test cases you need a good requirements document (what you refer to as 'client requirements'). If these requirements are written correctly, writing tests will be a piece of cake.
In the requirements document, there should be shall and will statements. For example:
the login page shall block a user after 10 failed logins
This is a testable requirement and then you write a test that has a user login incorrectly 10 times and sees if he can login successfully on the 11th try. Obviously you would be more specific in the test procedure, but that is the general idea.
Your example of having a login page isn't a good requirement. To test that requirement, you would just have to show that the login page exists. You want to be writing tests for specific features of this login page.
Also, there are will statements in a requirements document. These may not be required features depending on how the requirements were written, so you may not have to make tests for your will statements.

Test cases preparation is for understanding purpose of your project after testing. The test cases document is useful for you to quick review about the bugs/the cases status information either that test case is passed/failed.
Login Page:
Assume the login page in website or any other
Case1: What happens if you give valid Username and Invalid password
Case2: Invalid Username and Valid Password
Case3: Invalid Username and Invalid password
Case4: Valid User name and Valid Password
Case5: Empty User Name and Valid Password
Case6: Valid Username and Empty Password.

Here is a page with a brief overview over software testing and also a example of a table with test cases.
Software Testing Tutorial
This table can be of course extended to your needs, e.g. you will need a column for the result and maybe one for a comment, maybe for the test case are some preconditions needed, then add another column for that.
Here is a description of how to document a bug. (You will need that when you do your test ;-) )
Software Testing - Contents of a Bug

Positive test cases.
• Enter valid username and password.
• Click on forgot password link and retrieve the password for the username.
• Click on register link and fill out the form and register username and password.
• Use enter button after typing correct username and password.
• Use tab to navigate from username textbox to password textbox and then to login button.
..................................................................................
Negative test cases
• Enter valid username and invalid password.
• Enter valid password but invalid username.
• Keep both field blank and hit enter or click login button.
• Keep username blank and enter password.
• Keep password blank and enter username.
• Enter username and password wrong.

Related

Is test_scenario document and test plan document the same thing?

Task given to me is to derive a test plan I was provided with test_scenario document so I have no idea what I have to draft one of my colleague told me both are same document but I have my doubts about that
Please help
A test scenario is: "Check the Authentication feature".
A test plan could be:
log in with valid credentials
log in with invalid credentials for an existing user
log in with credentials for a non existing user
reset the password
and so on.

what are the difference between test cases and test scenarios in manual testing [duplicate]

I am little confused about test scenarios and test cases. What are the differences between them?
Let's say I have to test a box of matches. Am I right saying that following can be examples of test scenarios?
is the box able to contain x matches?
lets say the box is closed and I shake it vigorously. Are the matches still in the box?
Can you give me examples of test scenarios and test cases?
Example:
You are testing your phone:
Scenario:
Verify that device automatically connects to Wi-Fi if user creates new profile
Test cases:
case 1: create Wi-Fi profile and verify that it created successfully
case 2: verify that device succeeded to connect to Wi-Fi
In this example you have one test scenario that contains 2 test cases. Because 1st one refers to precondition
Test case consist of set of input values, execution precondition, excepted Results and executed post condition, developed to cover certain test Condition. While Test scenario is nothing but test procedure.
A Test Scenarios have one to many relation with Test case, Means A scenario have multiple test case. Every time we have write test cases for test scenario. So while starting testing first prepare test scenarios then create different-2 test cases for each scenario.
Test cases are derived (or written) from test scenario. The scenarios are derived from use cases.
Test Scenario represents a series of actions that are associated together. While test Case represents a single (low level) action by the user.
Scenario is thread of operations where as Test cases are set of input and output given to the System.
For example:
Checking the functionality of Login button is Test scenario and
Test Cases for this Test Scenario are:
1. Click the button without entering user name and password.
2. Click the button only entering User name.
3. Click the button while entering wrong user name and wrong password.
Etc…
Test Scenario is ‘What to be tested’ and Test Case is ‘How to be tested’.
in simple terms test scenarios provides and overview of what needs to be tested in which conditions. Whereas test cases outline how that condition will be tested with positive and negative outcome by changing the pre-conditions and required variables. Therefore, 1 scenario can have 1....1* test case relation.
For example,
Senario 1 - user connects to website using web URL and accesses his profile after successfully logging on as first page.
Test cases
ability to logon with username only
ability to logon with password only
ability to logon with username and password
ability to logon with incorrect username and password
ability to see user profile after logon
ability to see users historical orders after logon
I hope this makes a bit more sense. let me know if you do need further examples.
Test Scenario
Validate the login page
Test cases
Enter a valid username and password
Reset your password
Enter invalid credentials
Test cases are something you can depict in elaborated form.
Lets say that the test scenario is a "login page".
Given this test scenario, the test cases would be likely related to the login page and their attributes:
Validate the URL to display the login page
Validate the username and password textbox input field on the login page
Validate the alert message when username is defined, but password is empty, and the user clicks on login button
Validate the alert message when username is not defined, but password is there, and the user clicks on login button
In general, test case means how the test is and the test scenario what to be tested.
Here are an example regarding a ATM machine.
Test cases
Insert a ATM card which is valid
Enter your pin
Then display should be show with options like "withdraw", "check balance", etc.
Select the option which is needed
Finally, the machine should print a paper with details
Test scenario
Insert ATM card
Enter your pin
Select an option
Enter an amount
Withdraw money
For an given example: Testing an application like watsapp
Test scenarios: To validate user is able to make video calls.
Test cases: To validate user can make video calls to any number.
To validate the picture quality.
To validate the app doesn't crash when a call is made.
Test Scenario: A Test scenario is defined as any functionality that can be tested. Basically, it is a one-liner statement which tells us about testing particular functionality. One scenario can have multiple test cases
Test Case: A Test case is a set of inputs, execution conditions and expected results developed for a particular objective or output or specific test scenario to verify the requirement.
Let's take an example of Login and Search functionality to understand the test scenarios and test cases.
Test scenario 1: Check the Login functionality
Test case 1: Verify behaviour when valid email and password entered
Test case 2: Verify behaviour when invalid email and valid password entered
Test case 3: Verify behaviour when valid email and invalid password entered
Test case 4: Verify response when email and password are blank & press the login button
Test scenario 2: Check the Search functionality
Test case 1: Verify the search field is present and aligned
Test case 2: Verify place holder text was added on search or not
Test case 3: Verify search icon is present on the field
Test case 4: Verify cursor should present on and able to click on the search icon
Test case 5: Verify search field generating the correct result for correct keywords or not by adding a valid search

Sanity Test Case Writing

What is the difference in writing test cases and writing Sanity test cases for sign up of any website? Could anyone please let me understand by giving few test cases or example of Sanity test cases for sign up page of any website?
Sanity tests by name suggests the case that validate if the application is sane.
For example in context of sign up of a website, you may have the following tests as sanity:
Sign up option is available on login page.
Clicking "Sign up" redirects to proper , sign up form.
Clicking Sign in does not re-direct to "Sign up" form.
Submitting "Sign up" form goes successful, with out crash.
User signed up, is able to login.
The above are more then enough for a sanity test.
But for detailed testing you may include following tests in addition to the above one.
Signing up again, with same user id, is not allowed.
Sql injection is restricted.
Once signed up, user is allowed to sign in from multiple devices / browsers, without need to sign up again.
Cancelling mid-way sign up(half-filled form), is allowed.
Only the mandatory fields in form(if blank) should block the sign up.
Blank form sign up should not be allowed.
Sanity tests are done to check quickly whether application is behaving properly or not. It should not be very time consuming testing and is done in quick manner when you do not have enough time for testing.
Sanity tests does not have any specific tests cases and mostly done without test cases.
For sanity testing , Just need to check straight forward flow of application whether it is working or not. Sanity testing give confidence to team that some of direct error, Exception not getting on Work flow.
For an example, you wanna buy new car.
So when you are taking Test Drive that is called your Sanity Check
After one year of using that Car, When you are sharing your experience, that's called Detail Test
So Sanity check is basically overall check of all the links and UI, where Details Test cases are checking each and everything about the page with Negative and Positive Scenarios.
Every software testing services company follow the process of creating test cases before starting the feature testing. Sanity Testing is done when as a QA we do not have sufficient time to run all the test cases. Sanity test should be done only if QA team is running short of time, never use this for regular releases. Theoretically, this testing is a subset of Regression Testing.
Sanity test cases for validating Sign Up functionality quickly:
Sign up option is available on the login page.
Clicking "Sign up" redirects the user to appropriate sign up form.
User is able to fill details in all the mandatory fields of sign up form.
User is able to submit "Sign up" without any error.
User is able to access the account by using the credentials provided during sign up.
Regression test cases for 'Sign Up' form cover some other areas also:
Verifying sign up on all compatible OS and browsers
Cross Scripting is handled properly for all the fields on Sign up page.
Verifying that user is unable to sign up again with the same details.
Verify the behavior when sign up is in mid-way
Verifying that user is unable to sign up by leaving mandatory fields blank(This needs to be checked by leaving every mandatory field blank).
Appropriate error message w.r.t the field should be displayed on leaving any field blank.
Verify all the boundary values for text and numeric fields.
Sanity test in first to check sin up function.
TO check validation all field.
To check the sin up button on click work is yes and no.
TO all field enter After the submit button on click that time check cress.
To submit button on click direct home page to check.

Prepopulate Username and Password in Login screen

I have designed a standard login screen in ASP.NET like below:
As usual when operator selects “Remember me”, we expect system to not ask operator for credentials anymore and go directly to default (home) page.
My business team saw something on internet and they believe that when “Remember me” has been selected we need to pre populate the username and password and wait for customer to press “LOG IN” button:
I haven’t seen this practice so often and I am not very comfortable to do it. Although, I don’t have a good technical argument to explain and change their mind.
I am basically looking for good argument to explain cons and pros of above scenario.
Never ever should you pre-populate a passwords edit field. If you do so, everybody is able to read the plain-text password, if he can open the login form on this computer. A few minutes on an unlocked office computer would be enough to check the browser history, afterwards the attacker can login whenever and whereever he wants.
If you have a remember me function, and the user has logged in using this function, then there is no need to display the login form at all. You can just display the content. In this case, an attacker can do things with the account, but he cannot login unnoticed later from somwhere else.
I think (hope) you saw the pre-populated password field, because the browser filled in the content, and not the website did it. Maybe there is a password manager installed.

What's the difference between test scenario and test case?

I am little confused about test scenarios and test cases. What are the differences between them?
Let's say I have to test a box of matches. Am I right saying that following can be examples of test scenarios?
is the box able to contain x matches?
lets say the box is closed and I shake it vigorously. Are the matches still in the box?
Can you give me examples of test scenarios and test cases?
Example:
You are testing your phone:
Scenario:
Verify that device automatically connects to Wi-Fi if user creates new profile
Test cases:
case 1: create Wi-Fi profile and verify that it created successfully
case 2: verify that device succeeded to connect to Wi-Fi
In this example you have one test scenario that contains 2 test cases. Because 1st one refers to precondition
Test case consist of set of input values, execution precondition, excepted Results and executed post condition, developed to cover certain test Condition. While Test scenario is nothing but test procedure.
A Test Scenarios have one to many relation with Test case, Means A scenario have multiple test case. Every time we have write test cases for test scenario. So while starting testing first prepare test scenarios then create different-2 test cases for each scenario.
Test cases are derived (or written) from test scenario. The scenarios are derived from use cases.
Test Scenario represents a series of actions that are associated together. While test Case represents a single (low level) action by the user.
Scenario is thread of operations where as Test cases are set of input and output given to the System.
For example:
Checking the functionality of Login button is Test scenario and
Test Cases for this Test Scenario are:
1. Click the button without entering user name and password.
2. Click the button only entering User name.
3. Click the button while entering wrong user name and wrong password.
Etc…
Test Scenario is ‘What to be tested’ and Test Case is ‘How to be tested’.
in simple terms test scenarios provides and overview of what needs to be tested in which conditions. Whereas test cases outline how that condition will be tested with positive and negative outcome by changing the pre-conditions and required variables. Therefore, 1 scenario can have 1....1* test case relation.
For example,
Senario 1 - user connects to website using web URL and accesses his profile after successfully logging on as first page.
Test cases
ability to logon with username only
ability to logon with password only
ability to logon with username and password
ability to logon with incorrect username and password
ability to see user profile after logon
ability to see users historical orders after logon
I hope this makes a bit more sense. let me know if you do need further examples.
Test Scenario
Validate the login page
Test cases
Enter a valid username and password
Reset your password
Enter invalid credentials
Test cases are something you can depict in elaborated form.
Lets say that the test scenario is a "login page".
Given this test scenario, the test cases would be likely related to the login page and their attributes:
Validate the URL to display the login page
Validate the username and password textbox input field on the login page
Validate the alert message when username is defined, but password is empty, and the user clicks on login button
Validate the alert message when username is not defined, but password is there, and the user clicks on login button
In general, test case means how the test is and the test scenario what to be tested.
Here are an example regarding a ATM machine.
Test cases
Insert a ATM card which is valid
Enter your pin
Then display should be show with options like "withdraw", "check balance", etc.
Select the option which is needed
Finally, the machine should print a paper with details
Test scenario
Insert ATM card
Enter your pin
Select an option
Enter an amount
Withdraw money
For an given example: Testing an application like watsapp
Test scenarios: To validate user is able to make video calls.
Test cases: To validate user can make video calls to any number.
To validate the picture quality.
To validate the app doesn't crash when a call is made.
Test Scenario: A Test scenario is defined as any functionality that can be tested. Basically, it is a one-liner statement which tells us about testing particular functionality. One scenario can have multiple test cases
Test Case: A Test case is a set of inputs, execution conditions and expected results developed for a particular objective or output or specific test scenario to verify the requirement.
Let's take an example of Login and Search functionality to understand the test scenarios and test cases.
Test scenario 1: Check the Login functionality
Test case 1: Verify behaviour when valid email and password entered
Test case 2: Verify behaviour when invalid email and valid password entered
Test case 3: Verify behaviour when valid email and invalid password entered
Test case 4: Verify response when email and password are blank & press the login button
Test scenario 2: Check the Search functionality
Test case 1: Verify the search field is present and aligned
Test case 2: Verify place holder text was added on search or not
Test case 3: Verify search icon is present on the field
Test case 4: Verify cursor should present on and able to click on the search icon
Test case 5: Verify search field generating the correct result for correct keywords or not by adding a valid search