Full Stack Web Development Internship Program
- 5k Enrolled Learners
- Weekend/Weekday
- Live Class
In this Software Testing interview questions article, I have collected the most frequently asked questions by interviewers. These questions are collected after consulting with top industry experts in the field of Manual and Automation testing. If you want to brush up with the software testing basics, which I recommend you to do before going ahead with this Software Testing Interview Questions, take a look at this article on Software Testing Tutorial.
In case you came across some other questions during your interviews or have queries that might be helpful for others as well, do share them in the comment section of this article. Meanwhile, you can maximize the Automation testing career opportunities that are sure to come your way by taking Selenium Online Training with Edureka.
If you are a tech-savvy who wants to up-skill yourself with all the latest technologies, take a look at this list of Top Trending Technologies.
This Software Testing Interview question is divided into the following parts:
Let’s begin this software testing interview questions with beginners level questions first.
The different phases involved in the software testing life cycle are:
Requirement Analysis | Here, the QA team understands the requirements and identify the testable requirements. |
Test Planning | In this phase, the test strategy is defined. |
Test Case Development | Here, detailed test cases are defined and developed. |
Environment Setup | It is a setup of software and hardware for the testing teams to execute test cases. |
Test Execution | It is the process of executing the code and comparing the expected and actual results. |
Test Cycle Closure | It involves calling out the testing team member meeting & evaluating cycle completion criteria based on test coverage, quality, cost, time, critical business objectives, and software. |
There are three methods of software testing and they are as follows:
There are mainly four testing levels and they are:
Basically, it starts with the Unit Testing phase and ends with Acceptance Testing.
A defect life cycle is a process in which a defect goes through various phases during its entire lifetime. It starts when a defect is found and ends when a defect is closed, after ensuring it’s not reproduced.
Bug or defect life cycle includes the steps as illustrated in the below figure. If you wish to learn in depth about Bug Life Cycle then you can refer my article on Software Testing Tutorial.
It can vary from organization to organization and also from project to project based on several factors like organization policy, software development model used (like Agile, Iterative), project timelines, team structure etc.
A test case is nothing but a set of conditions or variables under which a tester will determine whether a system under test satisfies requirements or works correctly.
Functional Testing | Non Functional Testing |
Performed before non-functional testing | Performed after functional testing |
Based on customers expectations | |
Describes what the product does | Describes how the product works |
Verification: It is a static analysis technique. Here, testing is done without executing the code. Examples include – Reviews, Inspection, and walkthrough.
Validation: It is a dynamic analysis technique where testing is done by executing the code. Examples include functional and non-functional testing techniques.
In the V model, the development and QA activities are done simultaneously. There is no discrete phase called Testing, rather testing starts right from the requirement phase. The verification and validation activities go hand in hand.
It is a testing methodology where the end customer is asked to use the software to see if the product is easy to use, to see the customer’s perception and task time. An accurate way to finalize the customer point of view for usability is by using prototype or mock-up software during the initial stages.
There are three main categories of defects as shown in the below figure:
Basically, the acceptance document is prepared using the following inputs.
The parameter used in software testing to describe the extent to which the source code is tested is known as coverage. There are three basic types of coverage techniques and they are:
Benefits of Automation testing are:
Selenium is an open source tool which is used for automating the tests carried out on web browsers. Since Selenium is open-source, there is no licensing cost involved, which is a major advantage over other testing tools. Other reasons behind Selenium’s ever-growing popularity are:
Different components of Selenium are:
The locator is nothing but an address that identifies a web element uniquely within the webpage. Thus, to identify web elements accurately and precisely we have different types of locators in Selenium as follows:
XPath also called as XML Path is a language to query XML documents. It is an important strategy to locate elements in selenium. It consists of a path expression along with some conditions. Here, you can easily write XPath script/query to locate any element in the webpage. It is designed to allow the navigation of XML documents, with the purpose of selecting individual elements, attributes, or some other part of an XML document for specific processing. It also produces reliable locators.
It is the direct way to find the element, but the disadvantage of the absolute XPath is that, if there are any changes made in the path of the element then that XPath gets failed. For example: /html/body/div[1]/section/div[1]/div
For Relative XPath, the path starts from the middle of the HTML DOM structure. It begins with the double forward slash (//), which means it can search the element anywhere at the webpage. For example: //input[@id=‘ap_email’]
Exceptions in Selenium are similar to exceptions in other programming languages. The most common exceptions in Selenium are:
Selenium Grid can be used to execute same or different test scripts on multiple platforms and browsers concurrently so as to achieve distributed test execution, testing under different environments and saving execution time remarkably.
The following syntax can be used to launch the Browser:
WebDriver driver = new FirefoxDriver();
WebDriver driver = new ChromeDriver();
WebDriver driver = new InternetExplorerDriver();
Testing is always done after the build and execution phases Earlier we catch a defect, the more cost effective it is. For example, fixing a defect in maintenance is ten times more costly than fixing it during execution.
As test phases start moving ahead environment reality becomes more important. For example, while unit testing, you need the environment to be partly real, but at the acceptance phase you should have a 100% real environment, or we can say it should be the actual real environment.
The above graph shows during acceptance testing it should be 100% real.
If at the initial stage a defect is identified, then it should be removed during that stage/phase itself rather than at some later stage. It’s a fact that if a defect is delayed for later phases it becomes more costly. The following figure shows how a defect is costly as the phases move forward.
If a defect is identified and removed during the design phase, it is the most cost effective but when removed during maintenance it becomes twenty times costlier.
Regression Testing: It is defined as a type of software testing to confirm that a recent code change has not adversely affected existing features.
Confirmation Testing: When a test fails because of the defect, the defect is reported. Then a new version of the software is submitted whose defect is fixed. This is called as confirmation testing or re-testing.
Boundary Value Analysis (BVA) is a black box test design technique which is applied to see if there are any bugs at the boundary of the input domain.
Usually, in Random testing, data is generated randomly often using a tool. For example, the following figure shows how randomly-generated data is sent to the system.
This data is generated either using a tool or some automated mechanism. With this randomly generated input, the system is then tested and results are observed accordingly.
To estimate your project, you have to consider the following points:
Usually, black box test cases are written first and white box test cases later. To write black box test cases we need the requirement document and, design or project plan. These documents are easily available at the initial start of the project. White box test cases cannot be started in the initial phase of the project because they need more architecture clarity which is not available at the start of the project. So normally white box test cases are written after black box test cases are written.
The basic components of defect report format include:
Automation testing is very useful in agile methodology and helps in achieving maximum test coverage in a lesser time of the sprint.
By following criteria, the success of Automation testing can be mapped:
To access a website, a user sends a “request” to that website’s server, and the server sends back a response in the form of the website you want to access. To load test a website, quality assurance engineers and automation engineers just need to multiply the number of responses sent to simulate different traffic loads. The web server’s response to the influx of virtual users can then be measured. This is used to determine performance issues and server capacity.
Selenium | Sikuli |
It cannot automate flash objects like video player, audio player etc. | It provides extensive support to automate flash objects |
It has got complicated API | It has a simple API |
It can automate only web applications | It can automate the web as well as a windows application. |
driver.findElement(By.linkText(“Google”)).click();
This command finds the element using link text and then click on that element. Thus, the user would be re-directed to the corresponding page.
It is an advanced framework which is designed in a way to leverage the benefits by both the developers and testers. It also has an inbuilt exception handling mechanism which lets the program to run without terminating unexpectedly.
Below code helps you to understand how to set test case priority in TestNG.
package TestNG; import org.testng.annotations.*; public class SettingPriority { @Test(priority=0) public void method1() { } @Test(priority=1) public void method2() { } @Test(priority=2) public void method3() { } }
Test Execution Sequence:
Method1 Method2 Method3
Selenium | Quick Test Professional |
Selenium supports almost all the popular browsers like Firefox, Chrome, Safari, Internet Explorer, Opera etc | QTP supports Internet Explorer, Firefox and Chrome. QTP only supports Windows Operating System |
Selenium is distributed as an open source tool and is freely available | QTP is distributed as a licensed tool and is commercialized |
Selenium supports testing of only web-based applications | QTP supports testing of both the web-based application and windows based application |
Object Repository refers to the collection of web elements belonging to Application Under Test (AUT) along with their locator values. With respect to Selenium, objects can be stored in an excel sheet which can be populated inside the script whenever required.
By using sendKeys()method we can input the text in the text box using Selenium WebDriver.
This section help you practice with the advanced level and scenario based interview questions
An end user is the most important person because he is the one who has to use the product and has a keen interest that anyone else in the project.
Above figure illustrates the input that is essential from the user end.
A workbench at its core is a way of documenting how a specific activity has to be performed. It is often referred to as phases, steps, and tasks as shown in the following figure.
There are five tasks for every workbench and they are as follows:
Defect cascading is a defect which is caused by another defect. One defect triggers the other defect. When a defect is present in any stage but is not identified, hide to other phases without getting noticed. This will result in an increase in the number of defects.
Let us understand this by an example.
You are designing the Login Module of a WebPage:
In phase 1 – You are designing Register User Module for Login and mobile number is mandatory but you can leave it blank due to a bug that gets unnoticed.
In Phase 2 – You will design the login form having username and password. The password is OTP which will be sent to User’s registered mobile number.
Now as Register module has a bug that mobile number can be left blank so this may lead to Login failure or maybe some system error or crash if a null mobile number is not handled. This is known as defect cascading.
44. What are the different strategies for rollout to end users?
The strategies to be followed for rollout are as follows:
This is a tricky question which the interviewer might present to you. He can provide a situation wherein there are 20 links in a web page, and we have to verify which of those 20 links are working and how many are not working (broken).
As you have to verify the working of every link, the workaround is that you need to send HTTP requests to all of the links on the web page and analyze the response. Whenever you use driver.get() method to navigate to a URL, it will respond with a status of 200 – OK. This indicates that the link is working and it has been obtained. Whereas any other status indicates that the link is broken.
Let’s now understand how to do that.
First, we have to use the anchor tags <a> to determine the different hyperlinks on the web page. For every <a> tag, we can use the attribute ‘href’ value to obtain the hyperlinks and then analyze the response received when used in driver.get() method.
If frame name and frame id is not available, then we can use frame by index. For example, there are 3 frames in a web page and if none of them have a frame name and frame id, then we can still select those frames by using frame (zero-based) index attribute. All the frame will have an index number like the first frame would be at index “0”, the second at index “1” and the third at index “2”.
driver.switchTo().frame(int arg0);
By using the TakeScreenshot function you can take a screenshot. With the help of getScreenshotAs() method, you can simply save that screenshot. Example: File scrFile = ((TakeScreenshot)driver).getScreenshotAs(outputType.FILE);
If there is a pop up for logging in, we need to use the explicit command and verify if the alert is actually present. The below code helps you understand the use of explicit wait command.
WebDriverWait wait = new WebDriverWait(driver, 10); Alert alert = wait.until(ExpectedConditions.alertIsPresent()); alert.authenticateUsing(new UserAndPassword(**username**, **password**));
49. How to skip a method or a code block in TestNG?
To skip a particular test method or a code, then you can set the ‘enabled’ parameter in test annotation to false.
@Test(enabled = false)
WebElement sample = driver.findElement(By.xpath("//*[contains(text(), 'data')]"));
It defines a variable sample of type WebElement, and uses an XPath search to initialize it with a reference to an element that contains the text value “data”.
This brings us to the end of this article on Top 50 Software Testing Interview Questions. Hope it helped in adding up to your knowledge. Wishing you all the best for your interview. Happy learning.
If you found this “Software Testing Interview Questions” article relevant, check out the Software Testing Training by Edureka, a trusted online learning company with a network of more than 250,000 satisfied learners spread across the globe.
Got a question for us? Please mention it in the comments section on this Software Testing Interview Questions and we will get back to you.
Course Name | Date | |
---|---|---|
Software Testing Fundamentals Course | Class Starts on 25th February,2023 25th February SAT&SUN (Weekend Batch) | View Details |
Software Testing Fundamentals Course | Class Starts on 4th March,2023 4th March SAT&SUN (Weekend Batch) | View Details |
edureka.co