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

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

Related

Validation of text objects or handling on objects that dont appear in all cases in robot framework

I have to validate a page text after logging into an application,
Text/ that page dont appear everytime but if the page appears then I have to do some actions and if it dont appear then I have to proceed.
I tried the below methods :
1.
Run Keyword If Page Should Contain ${txt_HomePage} Login Successful
Else Login Unsuccessful
Login Successful
Log Successfully logged into application
Login Unsucessful
Log Please verify userid and password
${Result}= Page Should Contain ${txt_HomePage}
Run Keyword Unless '${RESULT}'=='PASS' Log Unsucessfull
Both the cases are failing, any other suggestion? How to handles that objects that dont appear in all cases
Robot Framework is not very elegant when need to test a system that does not always behave same way. You can use RF Run Keyword And Ignore Error to get pass/fail and work on that:
${status} ${message}= Run Keyword And Ignore Error Page Should Contain ${txt_HomePage}
IF "${status}" == "PASS"
Log Successfully logged into application
ELSE
Log Please verify userid and password
END

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

Should integration test bypass login natural processes in order don't retest same login functionality for many times

Let's say I'm testing a web service and I have a couple of scenarios requires user to be authenticated:
Scenario #1: Customer sign-up
Scenario #2: Customer sign-in
Scenario #3: Customer change name
Scenario #4: Customer update image
Should all the tests go through all login steps like:
1) Go to register page
2) Enter new user information
3) Activate account
4) Go to login page
5) Enter login and password
6) Press the Login button
7) Check if I authenticated as a customer
Or I can just test it once and implement endpoint which quickly creates a user and log it in.
So if I have that kind of endpoint that means I can skip retesting the same things all the time and just have short scenarios #3 and #4 implementation. But in this case, I have a less natural environment.
Please tell me about the best practices that you use in real projects.
Few best practices:
use the testing pyramid integration > ui (tests are much slower on UI, automate in the UI only the necessary things to have main flows covered)
for the UI use fast methods for the setup (so yes, web services, test login only once)
if possible keep some test data trough the builds (for example to make sure a new build that might change data structure does not affect basic functionality, e.g. login)
tests should be atomic (not depend on each other)
do some cleanup from time to time to remove duplicate test code and to improve the framework(speed, stability)
You shouldn't copy and paste the "log in" scenario to all of the other scenarios, but having an account and being logged in are prerequisites for the other use cases. From a behavior driven development perspective this will translate to one or more Given steps that simulate or actually perform those steps:
Scenario: Customer change name
# Calls web service or database to create new user
Given "Bob" is a registered user
# Calls web service or database to make account active
And "Bob" has an active account
# Opens browser, navigates to login page, fills out login form and submits it
And the user is logged in as "Bob"
# Steps specific to changing name and asserting it has changed
When the user changes their name to "Samuel"
Then the user's name is "Samuel"

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.

Test Case Preparation

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.