How to write testcases?
In this section we are explaining about how to write the testcases for any application.
Step 1: Understanding the business requirements
Step 2: Create the test suites for requirements
Step3: Create the testcases based on requirements
Read the following testcases for facebook and learn how to write testcases any application
We are using test link for testcase management ecause its open source and most of the organizations are using testlink for test management.
I can suggest for freshers read the following testcases several times , understand the test link tool, so that you can write testcases by own.
so many people asked me to put real-time project with testcases, because freshers will have many doubts regarding testcases. for now i have created for facebook, In future i will create test cases for real time project. Please put your suggestions in comments .
http://qalab.online/testlink/
username : raju
password: raju
Note: click on new user to create an new account so that you will have your own account. you will have guest access like above user.
After login click on the test specification from the top menu to view the list of test cases
FBTC-1:Verify that user able to login to the facebook with valid credentials
FBTC-2: Verify that user able to login to the facebook with valid credentials (mobile no)
FBTC-3:Verify that user should not able to login to the facebook with invalid credentials
FBTC-4:Verify that user should not able to login to the facebook with invalid credentials(invalid mob no)
FBTC-5:Verify that user shoulld able to search facebook user by email id
FBTC-6:Verify that user should able to search facebook user by display name
FBTC-7:Verify that user should able to logout from facebook application
FBTC-8:Verify that user should able to see online users/ offline users in chat slide bar
FBTC-9:Verify that user should able to search online users/ offline users from chat search
FBTC-10:Verify that user should able to enable chat sounds
FBTC-12: Verify that user should able to disable chat sounds
5) What is BVA (boundary value analysis)? Where you have used ?
It is a back-box testing technique used for testcase design ,here we will check for the above below edges of the fields (ex: username field)
for ex: if you consider this requirement username should take 7-9 characters then BVA for this is
max+1= 10 should not accept
min=7 shoud accept
min-1=6 should not accept
max=9 should accept
max-1=8 should accept
min+1=8 should accept
like this we can find out conditions
6) What is ECP( Equivalence class partition) ?
Equivalence class partition is a black-box testing technique which will divide the data into valid part and invalid parts means what kind of data should application accept and what kind of data application should not accept
for ex: consider this requirement username should take alphabets only
For above requirement we can write ecp like this
valid : alphabets
invalid: special characters, alphanumerics
7) What is decision table testing ?
It is a black-box testing technique used for documents complicated scenarios. advantage of decision table is we can cover every condition
click here for more information on this
8) What is defect age in software testing?
It is a time interval between defect found and defect closure
9) What is smoke testing in software testing?
After deploying code to testing environments first testers will do smoke test, in this testers will concentrate on the following things.
--> verify all the links (to find broken links)
--> verify critical functionalities(login, important functionalities, logout etc)
If tester find any bugs while doing smoke testing that will be the high priority issue
10) What is sanity Testing in Software testing?
After smoke test is successful testers will do sanity testing in this testers will concentrate on the following things
--> Verification of all major functionalities
--> Verification of newly implemented features in the current release
11) What is functional Testing?
In Functional testing Testers will test the functionality of the application, so tester will test each and every function of the application, Tester will check basic Usability(UI) of the application
Functional Testing flow
1) Understanding the business requirements(BRS,TDS)
2) Preparing Test data
3) Preparing testcases
4) Execution of testcases
5) comparison of expected results and actual results
Regression Testing: Regression testing is to figure out un expected side effects due to latest changes in the code. Some times recent bug fixes will cause to brake the existing functionality which was working fine before so testers will do regression testing to ensure that application is working fine with latest changes in code.
Regression testing tools:
1) selenium
2) QTP
3) Test complete
4) Sahi etc
--> Test plan
--> Test scenarios documents
Functional Testing flow
1) Understanding the business requirements(BRS,TDS)
2) Preparing Test data
3) Preparing testcases
4) Execution of testcases
5) comparison of expected results and actual results
12) What is the difference between Re-Testing and regression Testing?
Re-Testing: After fixing any bug by developer tester will test that bug to ensure whether it is working fine or not. In simple word we can say it is a confirmation testingRegression Testing: Regression testing is to figure out un expected side effects due to latest changes in the code. Some times recent bug fixes will cause to brake the existing functionality which was working fine before so testers will do regression testing to ensure that application is working fine with latest changes in code.
Regression testing tools:
1) selenium
2) QTP
3) Test complete
4) Sahi etc
13) What is Priority ?
It indicates the urgency of fixing bug in terms of client perspective
ex: In application client logo is not displayed. this bug we can consider as high priority but it will not affect the functionality so severity will be low.
14) What is Severity ?
It indicates the urgency of fixing bug in terms of project (functionality perspective)perspective.
15) What is Hot fix?
It is bug raised by the client side and developers needs to fix it immediately , after that testers need to work on testing of this bug as a priority to deliver to client as soon as possible
16) What is Installation Testing?
In Installation testing testers will install the software based on the provided document and verify the software is installed successfully as per the document or not (This is suitable for stand-alone applications ex: winzip)
17) What is Un-Installation Testing?
In un-Installation testing testers will un-install the software based on the provided document and verify the software is un-installed successfully as per the document or not (This is suitable for stand-alone applications ex: winzip)
18) What are the Test deliverables?
--> Test strategy
--> Test plan
--> Test Scripts
--> Test summery report
--> Test case document
--> Test scenarios documents
--> Requirements Traceability matrix(RTM)
--> Bug/issue report
--> Test results
19) What is show-stopper?
If testers not able to move-forward to test the application then it is called as show stopper.
ex: 1. Unable to login to the application
2. Any major functionality of the application is not working
Priority, severity of these bugs will be critical.
20) What is Test scenario?
Scenario identifies possible areas to be tested , later testcases describes step by step procedure to test that particular area. 1 Test scenario may have one or more testcases
written for a requirement
Must Read following articles
Agile Testing
Decision table in software Testing
V - Model
21) What is the status of the bug if the manager does not accept it ?
In some cases manager will move the bug to future release due to less priority and less time for release , In such cases status of the bug is differed
22) How many Testcases you will execute per day?
Its depends upon the complexity of the functionality in testcases
on average 20-25 testcases per day, If it is high complex testcases 10-15 testcases per day.
23) Give me an example for high priority and low severity?
If client logo is not loading properly we can consider it as high priority and low severity. Why because It will not effect any functionality but from the client point of view it is very important
24) What is requirement traceability matrix (RTM)?
Requirement traceability matrix helps to find out how many testcaseswritten for a requirement
Must Read following articles
Agile Testing
Decision table in software Testing
V - Model
Locating elements in selenium webdriver
1. ID:
Syntax : driver.findElement(By.id("element id"))2. CLASS:
Syntax: driver.findElement(By.className("element class"))3. NAME:
syntax: driver.findElement(By.name("element name"))4. TAGNAME:
syntax: driver.findElement(By.tagName("element html tag name"))5. CSS Selector:
syntax: driver.findElement(By.cssSelector("css selector"))6. Link:
syntax: driver.findElement(By.link("link text"))7. XPath:
syntax: driver.findElement(By.xpath("xpath expression"))package qalab;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Testid {
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.manage().window().maximize();
//maximizing browser window
String baseUrl = "http://qalabsonline.blogspot.com/2015/10/registration-page-for-selenium-practice.html";
driver.get(baseUrl);
driver.findElement(By.id("name")).sendKeys("Naveen");
// Here send keys is used for typing "Naveen" in name field
driver.close();
}
}
Decision Table in Software Testing
It is black-box testing technique, testers will use decision table to document the complicated scenarios, the advantage of decision table is it will cover each and every possible combinations.
Decision table contains two values
1. Conditions
2. Actions
lets discuss decision table with an example.
In this example i am taking an email login page example for decision table.
For login to any email application first we need to enter email and password.
Building decision table for Email and Password
In the above table "F" indicates the invalid data and "T" indicates the valid data. For the above scenario we have 4 possible conditions .
4 Test cases for above example: (here iam writing only testcase title)
1.Verify that user should not able to login to the email application with invalid email and invalid password.
2.Verify that user should not able to login to the email application with valid email and invalid password.
3. Verify that user should not able to login to the email application with invalid email and valid password.
4. Verify that user should able to login to the email application with valid email and valid password.
In the above testcases first 3 test cases are negative testcases and 4th test case is positive test case.
Lets take some complex example.
In this example i am including blank field also, Total 9 combinations are there in this example.
9 Testcases:
1.Verify that user should not able to login to the email application with blank email and blank password.
2.Verify that user should not able to login to the email application with blank email and invalid password.
3.Verify that user should not able to login to the email application with blank email and valid password.
4.Verify that user should not able to login to the email application with invalid email and blank password.
5.Verify that user should not able to login to the email application with invalid email and invalid password.
6.Verify that user should not able to login to the email application with invalid email and valid password.
7.Verify that user should not able to login to the email application with valid email and blank password.
8.Verify that user should not able to login to the email application with valid email and invalid password.
9.Verify that user should able to login to the email application with valid email and valid password.
In the above test cases First 8 are the negative testcases and 9th test case is positive test case
Decision table contains two values
1. Conditions
2. Actions
lets discuss decision table with an example.
In this example i am taking an email login page example for decision table.
For login to any email application first we need to enter email and password.
Building decision table for Email and Password
In the above table "F" indicates the invalid data and "T" indicates the valid data. For the above scenario we have 4 possible conditions .
4 Test cases for above example: (here iam writing only testcase title)
1.Verify that user should not able to login to the email application with invalid email and invalid password.
2.Verify that user should not able to login to the email application with valid email and invalid password.
3. Verify that user should not able to login to the email application with invalid email and valid password.
4. Verify that user should able to login to the email application with valid email and valid password.
In the above testcases first 3 test cases are negative testcases and 4th test case is positive test case.
Lets take some complex example.
In this example i am including blank field also, Total 9 combinations are there in this example.
9 Testcases:
1.Verify that user should not able to login to the email application with blank email and blank password.
2.Verify that user should not able to login to the email application with blank email and invalid password.
3.Verify that user should not able to login to the email application with blank email and valid password.
4.Verify that user should not able to login to the email application with invalid email and blank password.
5.Verify that user should not able to login to the email application with invalid email and invalid password.
6.Verify that user should not able to login to the email application with invalid email and valid password.
7.Verify that user should not able to login to the email application with valid email and blank password.
8.Verify that user should not able to login to the email application with valid email and invalid password.
9.Verify that user should able to login to the email application with valid email and valid password.
In the above test cases First 8 are the negative testcases and 9th test case is positive test case
Database Testing Interview Questions
1) Write a Query to display maximum salary of an employee from the below table
Table name: employee
Table name: employee
| EmpID | Empname | Salary |
| 101 | Naveen | 30000 |
| 102 | Saidesh | 32400 |
| 103 | Eshwar | 26300 |
| 105 | leeladhar | 86345 |
| 106 | vijeth | 10000 |
syntax: SELECT MAX(column_name) FROM table_name;
Query: SELECT MAX(Salary) FROM employee;
output: 86345
2) Write a Query to update the salary of an employee with 59000 for empid 106
Table name: employee
| EmpID | Empname | Salary |
| 101 | Naveen | 30000 |
| 102 | Saidesh | 32400 |
| 103 | Eshwar | 26300 |
| 105 | leeladhar | 86345 |
| 106 | vijeth | 10000 |
Ans:
Syntax:UPDATE <tablename> SET <column=value>
WHERE <somecolumn=somevalue>;
Query: UPDATE employee SET Salary=59000 where Empid=106;
output:
| EmpID | Empname | Salary |
| 101 | Naveen | 30000 |
| 102 | Saidesh | 32400 |
| 103 | Eshwar | 26300 |
| 105 | leeladhar | 86345 |
| 106 | vijeth | 59000 |
Subscribe to:
Posts (Atom)
