0% found this document useful (0 votes)
62 views

QA Idea Interview Questions

The document provides interview questions for test automation and API testing using Postman. It begins with questions about test automation frameworks and programming skills. It then lists several API testing tools and provides sample questions about Postman, including questions about environments, variables, authorization encoding, and using Postman for collaborative API testing.

Uploaded by

Jagannath k
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

QA Idea Interview Questions

The document provides interview questions for test automation and API testing using Postman. It begins with questions about test automation frameworks and programming skills. It then lists several API testing tools and provides sample questions about Postman, including questions about environments, variables, authorization encoding, and using Postman for collaborative API testing.

Uploaded by

Jagannath k
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

INTERVIEW QUESTIONS BY QA IDEA

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

*We will add daily interview questions at the end of document*

Most of the test automation interview questions are centered on the framework you develop, so it
is recommended that you create and understand your test framework thoroughly. When I am
interviewing, and the candidate has answered my question on the framework, I also prefer asking
a language-specific question (core java in my case).
The questions start from basics of java to write the logic of some basic scenario like:
● How would you extract a set of text from a given line?
● How would you extract the URL?
● In any web page, at any frame, the number of links and its content change dynamically,
how would you handle it?
● How do you handle images and flash objects?
● How do you find a word in a line?
Answers to all these test automation interview questions are very much specific to the
tool/language that you are using for automating. So before you go for the interview, brush up
your programming skills.
In case you did not get a chance to create your framework and someone else has created it, then
make some time to understand it thoroughly before sitting for the interview.
Some tips for automation testing interviews would be:
● Know your tool thoroughly.
● Learn the locator techniques used by your tool.
● Practice programming using the language which you use for automation testing.
● Learn your framework and its components.
● It’s always advantageous if you have been involved in the development of your
framework. So, be thorough with the modules in the framework which you have worked
on.
Hope these questions would be useful for you to prepare for a test automation interview.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

API POSTMAN INTERVIEW QUESTIONS


**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

1.What is Postman?
Postman is a rest client software that started as an chrome extension but is now available as native
application only. Postman is basically used for API testing in which you can test your APIs with different
types of request method types like post, put etc and parameters, headers and cookies. Apart from

1 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

setting the query parameters and checking the response, postman also let us see different response stats
like time, status, headers, cookies etc. with some extra excellent features that can be used with ease.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

2.What is an API?
API stands for Application Programming Interface. Talking in technical terms an API is a set of
procedures, functions, and other points of access which an application, an operating system, a library
etc., makes available to programmers in order to allow it to interact with other software. It can be
considered as the waiter which acts as the middleman between your requests and the chef. Similarly API
refers as the middleman between a client and a server. (Refer tutorial)
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

3.What are some tools used for API Testing?


There are many API testing tools. The following six are the top most according to the users/downloads.
These are not the rankings though.

Postman
SoapUI
Katalon Studio
Tricentis Tosca
Apigee
Jmeter
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

4.In which type of encoding does postman accept authorization credentials? Why?
Postman accept authorization in Base64 encoding only. This is provided inbuilt in Postman or else you
can also refer third party websites to convert the credentials in base64. We use base64 particularly
because it transmits the data into textual form and send it in easier form such as HTML form data. We
use Base64 particularly because we can rely on the same 64 characters in any encoding language that we
use. (Refer tutorial)
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

5.What is meant by the term Environment with respect to Postman?


An environment in Postman is a set of key-value pairs. You can create multiple env in postman which can
be switched quickly with a press of a button. There are two types of environment, global and local. They
define the scope of the variable to use it in the requests. Most commonly the variable is defined inside
the environment for the same purpose. The most common variable we use is url because url is used in
every requests and changing it can be very time consuming. When we create an environment inside

2 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

Postman, we can change the value of the key value pairs and the changes are reflected in our requests.
An environment just provides boundaries to variables.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

6.Can we have two global scope variables with the same name in Postman?
Since global variables are global i.e. without any environment, they cannot have duplicate names as it
creates confusion for the software. Local variables can have same name but in different environments.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

7.Which one has the higher priority in Postman? A global variable or a local variable?
In Postman, if two variables have same name (one being local and one being global) then the higher
priority is of the local variable. It will overwrite the global variable.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

8.Define Team workspace in Postman


A workspace is a collaborative environment for a group of users to develop and test APIs. A team
workspace is a workspace which is shared by the whole team working on same collections of requests.
Since it is very time consuming and hard to share the collections through external drives or other sharing
means, team workspace synchronises and collaborates all the team's work at one place.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

9.Explain the following piece of test code in Postman


tests[“Status Code is 200”] = responseCode.code === 200
● tests - variable on one of type array
● Status code is 200 - A string or the test name which will be represented in the test result box so
that we can know what test was it. It is important as we use many tests on one request.
● responseCode.code = responseCode is used to save all the response that we get from the server.
Since we do not need complete response, we need to create one object to extract our required
info. code object is then called to output the status code (like 200) from the entire response
which we have saved.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

10.What is the difference between Postman Monitors and Postman Collection Runner?
The postman Monitor is an automated way of running collections. Collections are triggered
automatically as per specified parameters whereas Postman Collections require some manual effort to

3 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

start and monitor the execution. A postman collection runner runs the collection for the iterations you
want to. It will be stopped when you stop the software and is not automated. A postman monitor will
run your collection at regular user defined intervals till the time you have specified. Your collection will
be run even if your system has shut down as it is connected through postman cloud.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

Can we import local variables in Postman Monitors?


Yes. Postman monitors allows to import local variables but it does not allow to import global variables. I
believe it can be imported in json, if yes, pls mention.(Refer tutorial)

Describe any four response things you receive from a response (Correct or Incorrect)
Status Code
Response Status
Response time
Response Size
Response Headers
Response Cookies
Response Date and Time
Response Session limit
Response Cookies
Response Server
Response type
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

What is a collection in Postman?


A collection in Postman can be imagined similar to a folder in your system. A collection is the grouping of
requests, preferably of the similar types. It can be compared similar to the folder inside your system
which has one type of files. It is one of the most vital feature of Postman and it also provides nice
features such as running a whole group of request together with just one click. A collection is also
important for sharing many requests at once and contains many more features which can be referred by
the given link.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

Should we save our work in Postman cloud if we are working in a company? Why?
A Postman cloud is Postman company's repository like Microsoft has One Drive etc. In Postman cloud
you can save your work instantly after logging in and also retrieve it from anywhere you want. It is not
preferred to save your work in Postman cloud as company's work is often confidential and should not be
leaked out. Postman cloud needs signing in and hence security can be compromised, therefore team
workspace is preferred instead of saving the work in Postman Cloud.
**********************************************************************************

4 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.


**********************************************************************************

State any 5 types of Request Method types.


Get
Post
Put
Delete
Patch
Head
Delete
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

Write a test code to check whether the response status is 200 or not.
A test code to check whether the response status is 200 or not is as follows

tests[“Status Code is 200”] = responseCode.code === 200;


**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

What is the need to Monitor the collections in Postman?


It is very important that your API’s responses and performance remain up to the mark throughout the
day. Monitors can help you schedule a collection of test runs to monitor the performance and response
of your APIs een if you are not available or not handling them. (Refer tutorial)
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

Can we run monitors in Postman without Signing in?


No, monitors cannot be run without signing in because monitors run your collection even if your system
is shut down. So, you need a place to store the collection and let it run automatically. You also need a
place to store the reports so that you can look at them when you are free. This all needs to be saved into
your postman account and hence you need to sign in. (Refer tutorial)
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

What is the importance of setNextRequest in Postman?


setNextRequest in Postman is used to define the workflow. setNextRequest is needed to change the
order of the requests being executed. (Refer tutorial)
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

5 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

What are the two types of scripts in Postman?


We can write two types of script in Postman

Tests script
Pre-request script
(Refer tutorial)
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

What is Chai Assertion Library?


Chai assertion library is an assertion library which is installed beforehand to use in Postman. This is used
to write assertions in Postman which are very beneficial. Chai assertion helps us write many lines of test
code in a few lines which is both understandable and readable. Chai uses BDD approach which means
that chai library has codes that are more user friendly.

A simple code written in chai library which tests if number 3 is already in array or not.

pm.test(“Number included”, function(){ pm.expect([1,2,3]).to.include(3); });


**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

SELENIUM INTERVIEW QUESTIONS


**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
**********************************************************************************

Ques 1) What are the annotations used in TestNG ?


Ans: @Test, @BeforeSuite, @AfterSuite, @BeforeTest, @AfterTest, @BeforeClass, @AfterClass,
@BeforeMethod, @AfterMethod.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 2) How do you read data from excel ?


FileInputStream fis = new FileInputStream(“path of excel file”);

Workbook wb = WorkbookFactory.create(fis);

Sheet s = wb.getSheet(“sheetName”);

String value = s.getRow(rowNum).getCell(cellNum).getStringCellValue();

6 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 3) What is the use of xpath ?


Ans- it is used to find the WebElement in web page. It is very useful to identify the dynamic web
elements.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 4) What are different types of locators ?


Ans- There are 8 types of locators and all are the static methods of the By class.
By.id(), By.name(), By.tagName(), By.className(), By.linkText(), By.partialLinkText(), By.xpath,
By.cssSelector().
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 5) What is the difference between Assert and Verify?


Ans- Assert- it is used to verify the result. If the test case fail then it will stop the execution of the test
case there itself and move the control to other test case.
Verify- it is also used to verify the result. If the test case fail then it will not stop the execution of that test
case.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************
Ques 6) What is the alternate way to click on login button?
Ans- use submit() method but it can be used only when attribute type=submit.

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 7) How do you verify if the checkbox/radio is checked or not ?


Ans- We can use isSelected() method.
Syntax –
driver.findElement(By.xpath("xpath of the checkbox/radio button")).isSelected();

If the return value of this method is true then it is checked else it is not.

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 8) How do you handle alert pop-up ?

7 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

Ans- To handle alert pop-ups, we need to 1st switch control to alert pop-ups then click on ok or cancle
then move control back to main page.
Syntax-
String mainPage = driver.getWindowHandle();

Alert alt = driver.switchTo().alert(); // to move control to alert popup

alt.accept(); // to click on ok.

alt.dismiss(); // to click on cancel.

//Then move the control back to main web page-

driver.switchTo().window(mainPage); → to switch back to main page.


**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 9) How do you launch IE/chrome browser?


Ans- Before launching IE or Chrome browser we need to set the System property.
//To open IE browser

System.setProperty(“webdriver.ie.driver”,”path of the iedriver.exe file ”);

WebDriver driver = new InternetExplorerDriver();

//To open Chrome browser → System.setProperty(“webdriver.chrome.driver”,”path of the


chromeDriver.exe file ”);

WebDriver driver = new ChromeDriver();

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 10) How to perform right click using WebDriver?


Ans- Use Actions class
Actions act = new Actions(driver); // where driver is WebDriver type

act.moveToElement(webElement).perform();

act.contextClick().perform();
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 11) How do perform drag and drop using WebDriver?

8 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

Ans- Use Action class


Actions act = new Actions(driver);

WebElement source = driver.findElement(By.xpath(“ -----”)); //source ele which you want to drag

WebElement target = driver.findElement(By.xpath(“ -----”)); //target where you want to drop

act.dragAndDrop(source,target).perform();

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 12) Give the example for method overload in WebDriver.


Ans- frame(string), frame(int), frame(WebElement).
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 13) How do you upload a file?


Ans- To upload a file we can use sendKeys() method.
driver.findElement(By.xpath(“input field”)).sendKeys(“path of the file which u want to upload”);
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 14) How do you click on a menu item in a drop down menu?
Ans- If that menu has been created by using select tag then we can use the methods selectByValue() or
selectByIndex() or selectByVisibleText(). These are the methods of the Select class.
If the menu has not been created by using the select tag then we can simply find the xpath of that
element and click on that to select.

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 15) How do you simulate browser back and forward ?


driver.navigate().back();

driver.navigate().forward();
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 16) How do you get the current page URL ?


driver.getCurrentUrl();

9 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 17) What is the difference between ‘/’ and ‘//’ ?


Ans- //- it is used to search in the entire structure.
/- it is used to identify the immediate child.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 18) What is the difference between findElement and findElements?


Ans- Both methods are abstract method of WebDriver interface and used to find the WebElement in a
web page.
findElement() - it used to find the one web element. It return only one WebElement type.
findElements()- it used to find more than one web element. It return List of WebElements.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 19) How do you achieve synchronization in WebDriver ?


Ans- We can use implicit wait.
Syntax- driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
Here it will wait for 10sec if while execution driver did not find the element in the page immediately. This
code will attach with each and every line of the script automatically. It is not required to write every
time. Just write it once after opening the browser.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 20) Write the code for Reading and Writing to Excel through Selenium ?
FileInputStream fis = new FileInputStream(“path of excel file”);

Workbook wb = WorkbookFactory.create(fis);

Sheet s = wb.getSheet("sheetName");

String value = s.getRow(rowNum).getCell(cellNum).getStringCellValue(); // read data

s.getRow(rowNum).getCell(cellNum).setCellValue("value to be set"); //write data

FileOutputStream fos = new FileOutputStream(“path of file”);

wb.write(fos); //save file


**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

10 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

Ques 21) How to get typed text from a textbox ?


Ans- use getAttribute(“value”) method by passing arg as value.
String typedText = driver.findElement(By.xpath("xpath of box")).getAttribute("value"));

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 22) What are the different exceptions you got when working with WebDriver ?
Ans- ElementNotVisibleException, ElementNotSelectableException, NoAlertPresentException,
NoSuchAttributeException, NoSuchWindowException, TimeoutException, WebDriverException etc.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 23) What are the languages supported by WebDriver ?


Ans- Python, Ruby, C# and Java are all supported directly by the development team. There are also
webdriver implementations for PHP and Perl.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 24) How do you clear the contents of a textbox in selenium ?


Ans- Use clear() method.
driver.findElement(By.xpath("xpath of box")).clear();
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 25) What is a Framework ?


Ans- A framework is set of automation guidelines which help in
Maintaining consistency of Testing, Improves test structuring, Minimum usage of code, Less
Maintenance of code, Improve re-usability, Non Technical testers can be involved in code, Training period
of using the tool can be reduced, Involves Data wherever appropriate.
There are five types of framework used in software automation testing:
1-Data Driven Automation Framework
2-Method Driven Automation Framework
3-Modular Automation Framework
4-Keyword Driven Automation Framework
5-Hybrid Automation Framework , its basically combination of different frameworks. (1+2+3).
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 26) What are the prerequisites to run selenium webdriver?

11 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

Ans- JDK, Eclipse, WebDriver(selenium standalone jar file), browser, application to be tested.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 27) What are the advantages of selenium webdriver?


Ans- a) It supports with most of the browsers like Firefox, IE, Chrome, Safari, Opera etc.
b) It supports with most of the language like Java, Python, Ruby, C# etc.
b) Doesn’t require to start server before executing the test script.
c) It has actual core API which has binding in a range of languages.
d) It supports of moving mouse cursors.
e) It support to test iphone/Android applications.

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 28) What is WebDriverBackedSelenium ?


Ans- WebDriverBackedSelenium is a kind of class name where we can create an object for it as below:
Selenium wbdriver= new WebDriverBackedSelenium(WebDriver object name, "URL path of website")

The main use of this is when we want to write code using both WebDriver and Selenium RC , we must
use above created object to use selenium commands.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 29) How to invoke an application in webdriver ?


driver.get(“url”); or driver.navigate().to(“url”);

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 30) What is Selenium Grid ?


Ans- Selenium-Grid allows you to run your tests on different machines against different browsers in
parallel. That is, running multiple tests at the same time against different machines, different browsers
and operating systems. Essentially, Selenium-Grid support distributed test execution. It allows for
running your tests in a distributed test execution environment.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 31) How to get the number of frames on a page ?


List <WebElement> framesList = driver.findElements(By.xpath("//iframe"));

12 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

int numOfFrames = frameList.size();


**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 32) How do you simulate scroll down action ?


Ans- Use java script to scroll down-
JavascriptExecutor jsx = (JavascriptExecutor)driver;

jsx.executeScript("window.scrollBy(0,4500)", ""); //scroll down, value 4500 you can change as per your
req

jsx.executeScript("window.scrollBy(450,0)", ""); //scroll up

ex-

public class ScrollDown {

public static void main(String[] args) throws InterruptedException {

WebDriver driver = new FirefoxDriver();

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

driver.get("https://www.flipkart.com/womens-clothing/pr?sid=2oq,c1r&otracker=hp_nmenu_sub_wom
en_1_View%20all");

driver.manage().window().maximize();

JavascriptExecutor jsx = (JavascriptExecutor)driver;

jsx.executeScript("window.scrollBy(0,4500)", ""); //scroll down

Thread.sleep(3000);

jsx.executeScript("window.scrollBy(450,0)", ""); //scroll up

}
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 33) What is the command line we have to write inside a .bat file to execute a selenium project
when we are using testng ?
Ans- java -cp bin;jars/* org.testng.TestNG testng.xml

13 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 34) Which is the package which is to be imported while working with WebDriver ?
Ans- org.openqa.selenium

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 35) How to check if an element is visible on the web page ?


Ans- use isDisplayed() method. The return type of the method is boolean. So if it return true then
element is visible else not visible.
driver.findElement(By.xpath("xpath of elemnt")).isDisplayed();

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 36) How to check if a button is enabled on the page ?


Ans- Use isEnabled() method. The return type of the method is boolean. So if it return true then button
is enabled else not enabled.
driver.findElement(By.xpath("xpath of button")).isEnabled();
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 37) How to check if a text is highlighted on the page ?


Ans- To identify weather color for a field is different or not-
String color = driver.findElement(By.xpath("//a[text()='Shop']")).getCssValue("color");

String backcolor = driver.findElement(By.xpath("//a[text()='Shop']")).getCssValue("background-color");

System.out.println(color);

System.out.println(backcolor);

Here if both color and back color different then that means that element is in different color.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 38) How to check the checkbox or radio button is selected ?


Ans- Use isSelected() method to identify. The return type of the method is boolean. So if it return true
then button is selected else not enabled.

14 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

driver.findElement(By.xpath("xpath of button")).isSelected();
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 39) How to get the title of the page ?


Ans- Use getTitle() method.
Syntax- driver.getTitle();
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 40) How do u get the width of the textbox ?


driver.findElement(By.xpath(“xpath of textbox ”)).getSize().getWidth();

driver.findElement(By.xpath(“xpath of textbox ”)).getSize().getHeight();

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 41) How do u get the attribute of the web element ?

Ans- driver.getElement(By.tagName("img")).getAttribute("src") will give you the src attribute of this tag.
Similarly, you can get the values of attributes such as title, alt etc.

Similarly you can get CSS properties of any tag by using getCssValue("some propety name").
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 42) How to check whether a text is underlined or not ?

Ans- Identify by getCssValue(“border-bottom”) or sometime getCssValue(“text-decoration”) method if


the

cssValue is 'underline' for that WebElement or not.

ex- This is for when moving cursor over element that is going to be underlined or not-

public class UnderLine {

public static void main(String[] args) {

WebDriver driver = new FirefoxDriver();

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

15 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

driver.get("https://www.google.co.in/?gfe_rd=ctrl&ei=bXAwU8jYN4W6iAf8zIDgDA&gws_rd=cr");

String cssValue= driver.findElement(By.xpath("//a[text()='Hindi']")).getCssValue("text-decoration");

System.out.println("value"+cssValue);

Actions act = new Actions(driver);

act.moveToElement(driver.findElement(By.xpath("//a[text()='Hindi']"))).perform();

String cssValue1= driver.findElement(By.xpath("//a[text()='Hindi']")).getCssValue("text-decoration");

System.out.println("value over"+cssValue1);

driver.close();

}
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 43) How to change the URL on a webpage using selenium web driver ?

driver.get(“url1”);

driver.get(“url2”);
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 44) How to hover the mouse on an element ?

Actions act = new Actions(driver);

act.moveToElement(webelement); //webelement on which you want to move cursor


**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
******************************************************************************************
Ques 45) What is the use of getOptions() method ?

Ans- getOptions() is used to get the selected option from the dropdown list.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

16 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

Ques 46) What is the use of deSelectAll() method ?


Ans- It is used to deselect all the options which have been selected from the dropdown list.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 47) Is WebElement an interface or a class ?


Ans- WebDriver is an Interface.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 48) FirefoxDriver is class or an interface and from where is it inherited ?


Ans- FirefoxDriver is a class. It implements all the methods of WebDriver interface.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 49) Which is the super interface of webdriver ?


Ans- SearchContext.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 50) What is the difference b/w close() and quit()?


Ans- close() - it will close the browser where the control is.
quit() - it will close all the browsers opened by WebDriver.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 1) Can we enter text without using sendKeys() ?


Ans - Yes we can enter text without using sendKeys() method. We have to use combination of javascript
and wrapper classes with WebDriver extension class, check the below code-
public static void setAttribute(WebElement element, String attributeName, String value)

WrapsDriver wrappedElement = (WrapsDriver) element;

JavascriptExecutor driver = (JavascriptExecutor)wrappedElement.getWrappedDriver();

driver.executeScript("arguments[0].setAttribute(arguments[1],arguments[2])", element,
attributeName, value);

17 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

call the above method in the test script and pass the text field attribute and pass the text you want to
enter.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 2) There is a scenario whenever "Assert.assertEquals()" function fails automatically it has to take
screenshot. How can you achieve this ?
Ans- By using EventFiringWebDriver.
Syntax-EventFiringWebDriver eDriver=new EventFiringWebDriver(driver);

File srcFile = eDriver.getScreenshotAs(OutputType.FILE);

FileUtils.copyFile(srcFile, new File(imgPath));


**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 3) How do you handle https website in selenium ?


Ans- By changing the setting of FirefoxProfile.
Syntax-public class HTTPSSecuredConnection {

public static void main(String[] args){

FirefoxProfile profile = new FirefoxProfile();

profile.setAcceptUntrustedCertificates(false);

WebDriver driver = new FirefoxDriver(profile);

driver.get("url");

}
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 4) How to login into any site if its showing any authetication popup for user name and pass ?
Ans - pass the username and password with url.
Syntax- http://username:password@url

ex- http://creyate:[email protected]

Ques 5) What is the name of Headless browser.


Ans- HtmlUnitDriver.
**********************************************************************************

18 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.


*******************************************************************************************

Ques 6) Open a browser in memory means whenever it will try to open a browser the browser page
must not come and can perform the operation internally.
Ans- use HtmlUnitDriver.
ex-
public class Memory {

public static void main(String[] args) {

HtmlUnitDriver driver = new HtmlUnitDriver(true);

driver.setJavascriptEnabled(false);

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

driver.get("https://www.google.co.in/");

System.out.println(driver.getTitle());

}
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 7) What are the benefits of using TestNG ?


Ans-
a) TestNG allows us to execute of test cases based on group.
b) In TestNG Annotations are easy to understand.
c) Parallel execution of Selenium test cases is possible in TestNG.
d) Three kinds of report generated
e) Order of execution can be changed
f) Failed test cases can be executed
g) Without having main function we can execute the test method.
h) An xml file can be generated to execute the entire test suite. In that xml file we can rearrange our
execution order and we can also skip the execution of particular test case.

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 8) How do you take screen shot without using EventFiringWebDriver ?


Ans-

19 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

File srcFile = ((TakeScreenshot)driver).getScreenshotAs(OutputType.FILE); //now we can do anything


with this screenshot

like copy this to any folder-

FileUtils.copyFile(srcFile,new File(“folder name where u want to copy/file_name.png”));


**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 9) How do you send ENTER/TAB keys in WebDriver ?


Ans- use click() or submit() [submit() can be used only when type='submit']) method for ENTER. Or use
Actions class to press keys.
For Enter-
act.sendKeys(Keys.RETURN);

For Tab-
act.sendKeys(Keys.ENTER);

where act is Actions class type. ( Actions act = new Actions(driver); )


**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 10) What is Datadriven framework & Keyword Driven ?


Ans- Datadriven framework- In this Framework , while Test case logic resides in Test Scripts, the Test Data
is separated and kept outside the Test Scripts.Test Data is read from the external files (Excel File) and are
loaded into the variables inside the Test Script. Variables are used both for Input values and for
Verification values.
Keyword Driven framework- The Keyword-Driven or Table-Driven framework requires the development
of data tables and keywords, independent of the test automation tool used to execute them . Tests can
be designed with or without the Application. In a keyword-driven test, the functionality of the
application-under-test is documented in a table as well as in step-by-step instructions for each test.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 11) While explaining the framework, what are points which should be covered ?
Ans-
a) What is the frame work.
b) Which frame work you are using.
c) Why This Frame work.
d) Architecture.
e) Explanation of every component of frame work.
f) Process followed in frame work.
g) How & when u execute the frame work.
h) Code (u must write code and explain).
i) Result and reporting .

20 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

j) You should be able to explain it for 20 Minutes.


**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 12) How to switch back from a frame ?


Ans- use method defaultContent().
Syntax – driver.switchTo().defaultContent();
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 13) How to type text in a new line inside a text area ?
Ans- Use \n for new line.
ex- webelement.sendKeys(“Sanjay_Line1.\n Sanjay_Line2.”);

it will type in text box as-


Sanjay_Line1.
Sanjay_Line2.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 14) What is the use of AutoIt tool ?


Ans- Some times while doing testing with selenium, we get stuck by some interruptions like a window
based pop up. But selenium fails to handle this as it has support for only web based application. To
overcome this problem we need to use AutoIT along with selenium script. AutoIT is a third party tool to
handle window based applications. The scripting language used is in VBScript.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 15) How to perform double click using WebDriver ?


Ans- use doubleClick() method.
Syntax- Actions act = new Actions(driver);

act.doubleClick(webelement);
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 16) How to press Shift+Tab ?


Ans-
String press = Keys.chord(Keys.SHIFT,Keys.ENTER);

webelement.sendKeys(press);
**********************************************************************************

21 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.


*******************************************************************************************

Ques 17) What is the use of contextClick() ?


Ans- It is used to right click.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 18) What is the difference b/w getWindowHandles() and getWindowHandle() ?


Ans- getWindowHandles()- is used to get the address of all the open browser and its return type is
Iterator<String>.
getWindowHandle()- is used to get the address of the current browser where the conrol is and return
type is String.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 19) How do you accommodate project specific methods in your framework ?
Ans- 1st go through all the manual test cases and identify the steps which are repeating. Note down such
steps and make them as methods and write into ProjectSpecificLibrary.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 20) What are different components of your framework ?


Ans- Library- Assertion, ConfigLibrary, GenericLibrary, ProjectSpecificLibrary, Modules.
Drivers folder, Jars folder, excel file.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 21) What are the browsers supported by Selenium IDE ?


Ans- Mozilla FireFox only. Its an Firefox add on.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 22) What are the limitations of Selenium IDE ?


Ans-
a) It does not supports looping or conditional statements. Tester has to use native languages to write
logic in the test case.
b) It does not supports test reporting, you have to use selenium RC with some external reporting plugin
like TestNG or JUint to get test execution report.
c) Error handling is also not supported depending on the native language for this.
d) Only support in Mozilla FireFox only. Its an Firefox add on.
**********************************************************************************

22 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.


*******************************************************************************************

Ques 23) How to check all checkboxes in a page ?


Ans-
List<webElement> chkBox = driver.findElements(By.xpath(“//htmltag[@attbute='checkbox']”));

for(int i=0; i<=chkBox.size(); i++){

chkBox.get(i).click();

}
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 24) Count the number of links in a page.


Ans- use the locator By.tagName and find the elements for the tag //a then use loop to count the
number of elements found.
Syntax- int count = 0;

List<webElement> link = driver.findElements(By.tagName(“a”));

System.out.println(link.size()); // this will print the number of links in a page.


**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 25) How do you identify the Xpath of element on your browser ? And- to find the xpath , we use
Firebug addons on firefox browser and to identify the xpath written we use Firepath addons.
Syntax- //htmltag[@attname='attvalue'] or //html[text()='textvalue'] or
//htmltag[contains(text(),'textvalue')] or //htmltag[contains(@attname,'attvalue')]

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 26) What is Selenium Webdriver ?


Ans- WebDriver is the name of the key interface against which tests should be written in Java. All the
methods of WebDriver have been implementated by RemoteWebDriver.

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 27) What is Selenium IDE ?

23 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

Ans- Selenium IDE is a complete integrated development environment (IDE) for Selenium tests. It is
implemented as a Firefox Add-On, and allows recording, editing, and debugging tests. It was previously
known as Selenium Recorder.
Scripts may be automatically recorded and edited manually providing autocompletion support and the
ability to move commands around quickly.
Scripts are recorded in Selenese, a special test scripting language for Selenium. Selenese provides
commands for performing actions in a browser (click a link, select an option), and for retrieving data
from the resulting pages.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 28) What are the flavors of selenium ?


Ans- selenium IDE, selenium RC, Selenium WebDriver and Selenium Grid.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 29) What is selenium ?


Ans- Its an open source Web Automation Tool. It supports all types of web browsers. Despite being open
source its actively developed and supported.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 30) Advantages of selenium over other tools ?


Ans-
a) Its free of cost,
b) it supports many languages like Java, C#, Ruby, Python etc.,
c) it allows simple and powerful DOM-level testing etc.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 31) What is main difference between RC and webdriver ?


Ans- Selenium RC injects javascript function into browsers when the web page is loaded.
Selenium WebDriver drives the browser using browser's built-in support.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 32) Why you choose webdriver over RC ?


Ans-
a) Native automation faster and a little less prone to error and browser configuration,
b) Does not Requires Selenium-RC Server to be running
c) Access to headless HTMLUnitDriver can allow really fast tests
d) Great API etc.

24 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 33) Which one is better xpath or CSS ?


Ans- xpath.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 34) How will you handle dynamic elements ?


Ans- By writing relative xpath.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 35) what are the different assertions or check points used in your script ?
Ans- The common types of validations are:
a) Is the page title as expected,
b) Validations against an element on the page,
c) Does text exist on the page,
d) Does a javascript call return an expected value.
method used for validation – Assert.assertEquals();
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 36) What is actions class in WebDriver ?


Ans- Actions class is used to control the actions of a mouse.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 37) What is the difference between @BeforeMethod and @BeforeClass ?


Ans- @BeforeMethod- this will execute before every @Test method.
@BeforeClass- this will execute before every class.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 38) What are the different attributes for @Test annotation ?
Ans- alwaysRun, dataProvider, dependsOnMethods, enabled, expectedExceptions, timeOut etc.
ex- @Test(expectedExceptions = ArithmeticException.class)

@Test(timeOut = 2000)
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.

25 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

*******************************************************************************************

Ques 39) Can we run group of test cases using TestNG ?


Ans- yes.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 40) What is object repository ?


Ans- An object repository is a very essential entity in any UI automation tool. A repository allows a tester
to store all the objects that will be used in the scripts in one or more centralized locations rather than
letting them be scattered all over the test scripts. The concept of an object repository is not tied to WET
alone. It can be used for any UI test automation. In fact, the original reason why the concept of object
repositories were introduced was for a framework required by QTP.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 41) What are oops concepts ?


Ans-
a) Encapsulation,
b) Abstraction,
c) Polymorphism,
d) Inheritance.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 42) What is inheritance ?


Ans- Inherit the feature of any class by making some relations between the class/interface is known as
inheritance.

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 43) What is difference between overload and override ?


Ans- The methods by passing different arguments list/type is known as overloading of methods while
having the same method signature with different method body is known as method overriding.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 44) Does java supports multiple inheritance ?


Ans- Interface supports multiple inheritance but class does not support.
**********************************************************************************

26 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.


*******************************************************************************************

Ques 45) Write a java program for swapping of two numbers ?


Ans-
public class Swapping{

public static void main(String[] args){

Scanner in = new Scanner(System.in);

System.out.println(“enter the 1st num”);

int a = in.nextInt();

System.out.println(“enter the 2nd num”);

int b = in.nextInt();

System.out.println(“before swapping a=”+a+” and b= ”+b);

int x = a;

a = b;

b = x;

System.out.println(“After swapping a=”+a+” and b= ”+b);

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 46) Write a java program for factorial of a given number.


Ans-
public class Factorial{

public static void main(String args[]){

Scanner in = new Scanner(System.in);

System.out.println(“enter the num for which u want the factorial”);

27 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

int num = in.nextInt();

for(int i=num-1; i>0; i-- ){

num = num*i;

System.out.println(num);

}
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 47) What are the different access specifiers in Java?


Ans- private, default, protected and public.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 48) Why do we go for automation testing ?


Ans- Reasons-
a) Manual testing of all work flows, all fields, all negative scenarios is time and cost consuming.
b) It is difficult to test for multi lingual sites manually.
c) Automation does not require human intervention. We can run automated test
unattended(Overnight).
d) Automation increases speed of test execution.
e) Automation helps increase test coverage.
f) Manual testing can become boring and hence error prone.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 49) What is testing strategy ?


Ans- A Test Strategy document is a high level document and normally developed by project
manager. This document defines “Software Testing Approach” to achieve testing objectives. The
Test Strategy is normally derived from the Business Requirement Specification document.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Ques 50) ) write a code to make use of assert if my username is incorrect.


Ans-
try{

28 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

Assert.assertEquals(expUserName, actUserName);

}catch(Exception e){

Syste.out.println(“name is invalid”);

}
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

TESTNG INTERVIEW QUESTIONS


**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

1. What is the TestNG Framework?


TestNG framework is a testing framework to perform tests in the java programming language. Moreover,
the "NG" in TestNG abbreviates for "Next Generation". Cedric Beust developed it and inspired by the
JUnit and NUnit testing framework. Subsequently, you can learn What is TestNG Framework in detail,
here.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

2. How do you run the TestNG script?


TestNG script is run by right-click on the TestNG class -> Run As -> TestNG Test. Subsequently, learn How
To Install TestNG In Eclipse And IntelliJ.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

3. What are the advantages of TestNG?


One of the common TestNG interview questions is about the advantages of TestNG.
TestNG has the following advantages:
● Firstly, TestNG is capable of producing reports automatically with all the necessary information
such as failed tests, passed tests, test execution times, etc.
● Secondly, TestNG makes use of annotations such as @BeforeMethod, @Test, etc., which are
easily understandable as their naming is after their working.
● Thirdly, TestNG provides a grouping of methods by which we can group multiple methods as one
unit. In other words, Grouping performs operations on all the tests in a group at once rather
than individually.
● Fourthly, TestNG provides a test method parameterization, which means we can provide
parameters in the TestNG and call the function repeatedly with different values. Moreover,
parameterization helps in data-driven testing in TestNG.

29 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

● Fifthly, TestNG provides the prioritization of methods. In other words, by defining the priorities
of the methods in TestNG, we can alter the default execution sequence of the test methods
according to our wish.
● In addition to the above, TestNG allows parallel testing, which increases efficiency and improves
the overall running time of test methods.
● With the TestNG framework, you can easily integrate with other tools such as Maven, Jenkins,
etc.
● Moreover, TestNG provides a feature to run multiple test methods on various browsers to test
for cross-browser compatibility issues on your website. It is cross-browser testing.
● Additionally, TestNG allows us to run the tests separately. So, if you run the tests and only one
test failed, you can run this test independently in the next execution.
● Moreover, TestNG allows the test methods to depend on each other. Its also called Test
Dependency in TestNG.
● Lastly, TestNG provides a bunch of assertion methods for testing more efficiently.
Subsequently, you can learn more about the benefits of the TestNG framework here.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

TestNG Test Case And Suites


4. What is the difference between a TestNG test and a TestNG test suite?
TestNG test suite refers to a collection of tests that we can run simultaneously with the help of the
TestNG XML file. On the other side, a TestNG test is a single test case file, and when we say "we are
running a TestNG test case", we simply mean we are running a single test case file. Learn more about
TestNG Test Suite.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

5. Define the correct order of tags in the TestNG XML file.


The correct order followed to run the TestNG suite from the XML file is as follows:
<suite>
<test>
<classes>
<class>
<methods>
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #5) How do you identify the test cases which are suitable for automation?
Answer: Identifying the appropriate test cases for automation is the most important step towards
automation.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

30 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

Q #6) Can you achieve 100% automation?


Answer: 100% automation would be difficult to achieve because there would be many edge test cases
and some cases that are executed seldom. Automating these cases which are not executed that often
will not add value to the automated suite.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #7) How to decide the tool that one should use for Automation testing in their projects?
Answer: In order to identify the tool for Automation testing in your project:
a) Understand your project requirements thoroughly and identify the testing scenarios that you want to
automate.
b) Search for the list of tools that support your project’s requirements.
c) Identify your budget for the automation tool. Select the tools within your budget.
d) Identify if you already have skilled resources for the tools. If you don’t have the necessary skilled
resources then identify the cost for training the existing resources or hiring new resources.
e) Now compare each tool for key criteria like:
● How easy is it to develop and maintain the scripts for the tool?
● Can a non-technical person also execute the test cases with little training?
● Does the tool support different types of platforms like web, mobile, desktop, etc based on your
project requirements?
● Does the tool have a test reporting functionality? If not, is it easily configurable for the tool?
● How is the tool for cross-browser support for web-based applications?
● How many different testing types can this tool support?
● How many languages does the tool support?
f) Once you have compared the tools, select the tool which is within your budget and support your
project requirements, and gives you more advantages based on the key criteria mentioned above.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #8) Currently I do not have any automation in place in my project, but now I want to implement
automation, what would be my steps?
Answer:
● First, identify which type of testing/test cases you want to automate.
● Identify the tool
● Design the framework
● Create utility files and environment files.
● Start scripting
● Identify and work on reporting.
● Allocating time for enhancing and maintaining the scripts.
Steps required for getting Automation Testing in place for a project include:
● Understand the advantages and disadvantages of automation testing and identify the test
scenarios which are suitable for automation.
● Select the automation tool that is best suited for automating the identified scenarios
● Find the tool expert to help in setting up the tool and required environment for executing the
test cases using the tool.

31 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

● Train the team so that they can write scripts in the programming language that the tool
supports.
● Create the test framework or identify the already existing one that meets your requirements.
● Write an execution plan for OS, browsers, mobile devices, etc.
● Write programming scripts for manual test cases to convert them into automated test cases.
● Report the test case status by using the reporting feature of the tool.
● Maintain the scripts for ongoing changes or new features.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #9) How do you decide which tool you have to use?


Answer: Concluding which tool is best suitable for the project requires a lot of brainstorming and
discussions.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #10) Once you identify the tool what would be your next steps?
Answer: Once we finalize the tool, our next step would be to design the framework.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #11) What is a framework?


Answer: A framework is a set of the structure of the entire automation suite. It is also a guideline, which
if followed can result in a structure that is easy to maintain and enhance.
These guidelines include:
● Coding standards
● Handling the test data
● Maintaining and handling the elements (object repository in QTP)
● Handling of environment files and properties file
● Reporting of data
● Handling logs

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #12) What are the attributes of a good framework?


Answer: The characteristics include:
● Modular: The framework should be adaptable to change. Testers should be able to modify the
scripts as per the environment or login information change.
● Reusable: The commonly used methods or utilities should be written in a common file that is
accessible to all the scripts.
● Consistent: The suite should be written in a consistent format by following all the accepted
coding practices.

32 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

● Independent: The scripts should be written in such a way that they are independent of each
other. In case one test fails, it should not hold back the remaining test cases (unless it is a login
page)
● Logger: It is good to have implemented the logging feature in the framework. This would help in
case our scripts run for longer hours (say nightly mode), if the script fails at any point of time,
having the log file will help us to detect the location along with the type of the error.
● Reporting: It is good to have the reporting feature automatically embedded into the framework.
Once the scripting is done, we can have the results and reports sent via email.
● Integration: Automation Framework should be such that it is easy to integrate with other
applications like continuous integration or triggering the automated script as soon as the build is
deployed.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #13) Can you do without a framework?


Answer: Frameworks are guidelines and not mandatory rules, so we can do without a framework, but if
we create it and follow it, enhancing and maintaining would be easy to implement.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #14) What are the different types of the Automation tool that you are aware of?
Answer: Open source tool like Selenium, JMeter, etc.
Paid tools like QTP, Load Runner, Ranorex, RFT, and Rational Robot.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #15) What generally is the structure of a framework?


Answer: Normally the structure should have – (It would differ from project to project)
● A “src” (source) folder having the actual test scripts.
● A”lib” (library) folder having all the libraries and common methods.
● A “class” folder having all the class file (in-case using java).
● A “log” folder having the log file(s).
● A file/folder having all the web element Ids.
● A file containing the URL, environment and login information.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #16) Where will you maintain information like URL, login, password?
Answer: This information should always be maintained in a separate file.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

33 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

Q #17) Why do you want to keep this kind of information in a separate file and not directly in the code?
Answer: URL, Login, and passwords are the kind of fields that are used very often and these change as
per the environment and authorization. In case we hardcode it into our code, we have to change it in
every file which has its reference.
In case if there are more than 100 files, then it becomes very difficult to change all the 100 files and this,
in turn, can lead to errors. So this kind of information is maintained in a separate file so that updating
becomes easy.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #18) What are the different types of frameworks?


Answer: Different types of frameworks includes:
● Keyword-driven framework
● Data-Driven framework
● Hybrid Framework
● Linear Scripting
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #19) Can you tell some good coding practices while automation?
Answer: Some of the good coding practices include:
● Add appropriate comments.
● Identify the reusable methods and write it in a separate file.
● Follow the language-specific coding conventions.
● Maintain the test data in a separate file.
● Run your scripts regularly.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #20) Any kind of test which you think should not be automated?
Answer:
● Tests that are seldom executed.
● Exploratory testing
● Usability testing
● Test which is executed quickly when done manually.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #21) Do you think that testing can be done only at the UI level?
Answer: Today as we are moving to the Agile mode, testing is not limited to the UI layer. Early feedback is
imperial for an agile project. If we concentrate only on the UI layer, we are actually waiting until the UI is
developed and available to test.
Rather we can test even before the UI is actually developed. We can directly test the APIs or the
methods using tools like Cucumber and FitNesse.

34 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

In this way, we are giving the feedback much early and are testing even before the UI is developed.
Following this approach will help us to test only the GUI aspect of small cosmetic changes or some
validations on the UI and will help the developers by giving more time to fix the bugs.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #22) How do you select which automation tool is best suited for you?
Answer: Selecting the automation tool depends upon various factors like:
● The scope of the application which we want to automate.
● Management overhead like cost and budget.
● Time to learn and implement the tool.
● Type of support available for the tool.
● Limitation of the tool
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #23) What do you think holds the testers back to do automation? Is there a way to overcome it?
Answer: The major hurdle for testers is to learn programming/coding when they want to automate. Since
testers do not code, adapting to coding is a bit challenging for testers.
We can overcome it by:
● Collaborating with developers when automating.
● Considering that automation is the responsibility of the whole team and not only of the testers.
● Giving a dedicated time and focus on automation.
● Getting proper management support.
You can save these automation testing interview questions as a pdf and print for further reading.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #24) What is an Automation testing framework?


Answer: A framework, in general, is a set of guidelines. A set of guidelines, assumptions, concepts and
coding practices for creating an execution environment in which the tests will be automated, is known as
an Automation testing framework.
An automation testing framework is responsible for creating a test harness with a mechanism to connect
with the application under test, take input from a file, execute the test cases and generate the reports
for test execution. An automation testing framework should be independent of the application and it
should be easy to use, modify or extend.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #25) What are the important modules of an automation testing framework?


Answer: Important modules of an Automation testing framework are:
1. Test Assertion Tool: This tool will provide assert statements for testing the expected values in the
application under test. For Example. TestNG, Junit, etc.

35 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

2. Data Setup: Each test case needs to take the user data either from the database or from a file or
embedded in the test script. Frameworks data module should take care of the data intake for
test scripts and the global variables.
3. Build Management Tool: Framework needs to be built and deployed for the use of creating test
scripts.
4. Continuous integration tool: With CICD (Continuous Integration and Continuous Development) in
place, continuous integration tool is required for integrating and deploying the changes done in
the framework at each iteration.
5. Reporting tool: A reporting tool is required to generate a readable report after the test cases are
executed for a better view of the steps, results, and failures.
6. Logging tool: The logging tool in framework helps in better debugging of the error and bugs.

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #28) When do you prefer Manual testing over Automation testing?


Answer: We prefer manual testing over automation testing in the following cases:
● The project is short-term and writing scripts will be time-consuming and costly when compared
to manual testing.
● Flexibility is required. Automated test cases are programmed and run in a specific way of
configurations.
● Usability testing needs to be performed.
● Applications/module is newly developed and has no previous test cases.
● Ad-hoc or exploratory testing needs to be performed.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #29) Is Automation testing in agile Methodology useful or not?


Answer: Automation testing is useful for regression, smoke or sanity testing. All these types of testing in
the traditional waterfall model happen at the end of the cycle and sometimes if there are not many
enhancements to the application, we might not even have to do regression testing.
Whereas, in agile methodology, every iteration requires executing the regression test case as some new
functionalities is added.
Also, the regression suite itself keeps growing after each sprint as the functional test cases of the current
sprint module need to be added to the regression suite for the next sprint.
Thus, Automation testing in agile methodology is very useful and helps in achieving maximum test
coverage in less time of the sprint.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #30) List some advantages and disadvantages of Automation testing.


Answer:
Advantages:
● Fewer human resources
● Reusability

36 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

● More Test Coverage in less time


● Reliability
● Parallel execution of test cases
● Fast
Disadvantages:
● Development and maintenance time is more.
● Tool Cost
● Skilled resources are required.
● Environment setup
● Test Script debugging is an issue.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #31) List some advantages and disadvantages of Manual testing.


Answer:
Advantages:
● No environment setup needed.
● Programming knowledge is not required.
● Recommended for dynamically changing requirements.
● Allow human observation power to detect more bugs.
● The cost is less for short-term projects.
● Flexibility
Disadvantages:
● Difficult to perform complex calculations.
● Reusability
● Time taking
● High risk of human errors or mistakes.
● More human resources are required.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #32) Can we do Automation testing without a framework? If yes, then why do we need a framework?
Answer: Yes, We can perform automation testing even without using a framework. We can just
understand the tool that we are using for automation and program the steps in the programming
language that tools support.
If we automate test cases without a framework then there won’t be any consistency in the programming
scripts for test cases.
A framework is required to give a set of guidelines that everyone has to follow to have maintained
readability, reusability, and consistency in the test scripts. A framework also provides one common
ground for reporting and logging functionality.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #33) How will you automate basic “login” functionality test cases for an application?
Answer: Assuming that the automation tool and framework is already in place of the test environment.

37 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

To test the basic “Login” functionality:


● Understand the project requirement: Login functionality will have a username textbox, a
password textbox, and a login button.
● Identify the Test scenarios: For login functionality, the possible test scenarios are:
○ Blank username and password
○ Invalid username and password
○ A valid username and invalid password
○ Valid username and password
● Prepare a Data input file with the data corresponding to each scenario.
● Launch the tool from the program.
● Identify the username field, password field, and the login button.
● For each test scenario, get the data from the data file and enter into the corresponding fields.
Program click on the login button after entering the data.
● Validate the error message for negative scenarios and the success message for positive scenarios
in the test script with the help of assertions.
● Run the test suite and generate the report.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #34) Is Automation testing a Black box testing or White-box testing?


Answer: Automation testing is mostly a black box testing as we just program the steps that a manual
tester performs for application under test without knowing the low-level design or code of the
application.
Sometimes, automated test scripts need access to the database details that are used in the application
under test or some more coding details and thus can be a type of white-box testing.
Thus automated testing can be both black or white box type of testing depending on the scenarios in
which automation is performed.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #35) How many test cases have you automated per day?
Answer: Well, the number depends on the complexity of the test cases. When the complexity was
limited, I was able to automate 5 to 6 test cases per day. Sometimes, I was able to automate only one
test case for complex scenarios.
I have also broken down my test cases into different components like, take input, do the calculation,
verify the output etc. in case of very complex scenarios and have taken 2 or more days.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #36) What factors determine the effectiveness of Automation testing?


Answer: Some of the factors that determine the effectiveness of automation testing are:
● Time saved by running scripts over the manual execution of test cases.
● Defects found
● Test Coverage or code coverage

38 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

● Maintenance time or development time


● Stability of the scripts
● Test Reusability
● Quality of the software under test
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #37) Which test cases can be automated?


Answer: Types of test cases which can be automated are:
(i) Smoke test cases: Smoke testing is also known as build verification testing. Smoke test cases are run
every time when a new build is released to check the health of the build for acceptance to perform
testing.
(ii) Regression Test Cases: Regression testing is the testing to ensure that previously developed modules
are functioning as expected after a new module is added or a bug is fixed.
Regression test cases are very crucial in incremental software approach where a new functionality is
added at each increment phase. In this case, regression testing is performed at each incremental phase.
(iii) Complex Calculation test cases: Test cases which involve some complex calculations to verify a field
for an application fall into this category. Complex calculation results are more prone to human errors
hence when automated they give accurate results.
(iv) Data-driven test cases: Test cases which have the same set of steps and run multiple times with the
change of data are known as data-driven test cases. Automated testing for these kinds of test cases is
quick and cost-effective.
(v) Non-functional test cases: Test cases like load tests and performance tests require a simulated
environment with multiple users and multiple hardware or software combinations.
Setting up multiple environments manually is impossible for each combination or number of users.
Automated tools can easily create this environment to perform non-functional testing easily.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #38) What are the phases in Automation testing Life Cycle?


Answer: The phases in Automation testing life Cycle include:
1. The decision to perform automation testing.
2. Identify and learn about the automation tool.
3. Determine the scope of automation testing.
4. Design and develop a test suite.
5. Test Execution
6. Maintenance of test scripts.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Q #39) What is an Automated test script?


Answer: An automated test script is a short program that is written in a programming language to
perform a set of instructions on an application under test to verify if the application is as per the
requirements.

39 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

This program when run, gives the test results as pass or fail to depend on if the application is as per the
expectations.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Updated on: 27/12/2022

1. Write steps to automate primary “login” functionality test cases for an application?
Here are the steps to automate basic login functionality:
Step 1) Understand the project requirement.
Step 2) Identify the Test scenarios
Step 3) Prepare a data input file with the data corresponding to each scenario
Step 4) Launch the tool from the program.
Step 5) Identify the username, password, and login buttons.
Step 6) Verify that the error message for negative scenarios is the same as the success message for
positive test -scenarios.
These interview questions will also help in your viva(orals)
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

2. Where will you maintain information like URL, login, and password?
URL, login, and password are important information used very often and change frequently. They should
always be maintained in a separate file. If not done, then the automation tester must change it in every
file with its reference.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

3. Is Automation testing white box testing or black box testing?


Automation testing is primarily black box testing.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

4. What are the Prerequisites of Automation Testing?


A few important pre-requisites of Automation Testing are:
● A stable build
● Functionalities to be tested
● Test cases for automated Testing
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

5. What is the average number of test cases you have automated per day?

40 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

The answer depends on the length and complexity of the test scenario. Generally, a QA tester can
automate 2-4 test scenarios daily when the complexity is limited. However, sometimes it might reduce to
1-2 when the complexity is high.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Date: 28/12/2022

1. What do you mean by XPath expressions?


XPath defines a pattern or path expression to select nodes or node sets in an XML document. These
patterns are used by XSLT to perform transformations. XPath specifies seven types of nodes that can be
output of the execution of the XPath expression.
● Root
● Element
● Text
● Attribute
● Comment
● Processing Instruction
● Namespace
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

2. What is XPath syntax?


The XPath syntax specifies the different nodes, path expressions, path notation, predicates and URLs
which are used to define the XML document.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

3. What do you understand by XPath number functions?


In XPath, number functions are used to fetch the different type of values from the expressions. For
example, ceiling value, floor value etc.
There are four types of number functions in XPath:
● ceiling()
● floor()
● round()
● sum()
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

4. How to define relationship among nodes?


There are following types of nodes in XPath. These nodes are related to each other to form a tree like
structure. These nodes are:
● Parents

41 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

● Children
● Siblings
● Ancestors
● Descendents
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

5. What are the different XPath Axes?


XPath axes are used to set relation of current node with another node. A list of XPath axes to set relation
with other nodes are:
● ancestor: It is used to get all ancestor (parent, grandparent etc) of current node.
● ancestor-or-self: It is used to get all ancestors (parent, grandparent, etc.) of the current node and
also the current node.
● attribute: It is used to get all attributes of the current node.
● child : It is used to retrieve all children of the current node.
● descendant: It is used to get all descendants (children, grandchildren, etc.) of the current node.
● namespace: It is used to get all namespace nodes of the current node.
● preceding: It is used to get everything in the document that is comes before the start tag of the
current node.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Date: 29/12/2022
Framework Related questions:
6. Have you created any Framework in your project?
Ans: If you are a beginner or fresher or having below 2 years of experience, your answer should be No. I
didn’t get a chance to create a framework. I have used the framework in the project which is already
available in my organization.
If you are an experienced tester and having 2.5 years of experience, your answer should be Yes or No,
depending in your knowledge. I have created a framework. If your answer is No, but I have involved in
the creation of the framework.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

7. What are the advantages of using Selenium Automation Framework?


Ans: There are several advantages to using a selenium automation framework. They are as follows:
● Increases code reusability. Create one time and execute multiple times with less or no
maintenance.
● Easier to use.
● Improved code understandability and readability.
● The automation framework provides flexibility to code.
● Reduces script maintenance.
● It generates automatic test reports after test execution.

42 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

25. What is Object Repository?


Ans: An object repository is a common storage location where we store a collection of all required
application objects and their properties. It is mainly used to store element locator values in a central
location to avoid hard coding within scripts.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

28. What is Properties file in Selenium?


Ans: Properties file in Selenium is a text file wherein data is stored in the form of key-value pairs. We will
create properties file to store all element locators.
This properties file acts as an object repository in Selenium WebDriver.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

29. How do we store data into properties file?


Ans: In the properties file, data is stored in the form of Key-Value pairs. The key-value pair is represented
by two string values separated by the equal sign. We store element name and locator values of
WebElement into the properties file to identify web elements.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Date: 30/12/2022
SDET Interview Questions

1) What is the definition of ad hoc testing?


Adhoc testing is informal testing. It is performed without any planning and documentation. This kind of
test is conducted randomly without any expected results.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

2) State the difference between priority and severity


Priority means how important a bug is to be fixed, while severity means how- harmful or damaging the
bug is to the system.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

3) Describe roles and responsibilities of this job

43 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

● Need to perform Test Automation and set up frameworks on platforms like Web and Mobile.
● Create & manage bug reports and constantly remain in touch with the development team.
● Communicate with clients
● You should also be able to set up and manage test automation frameworks independently.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

4) Discuss Typical working day of SDET


On a daily basis, you mostly occupied on the following tasks:
1. Understand project requirements
2. Creating and executing test cases
3. Reporting and testing bugs
You also need to give your input to the design and development team.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

5) What are the elements of a good bug report?


A good bug report contains a
● Descriptive summary of the bug
● The steps to reproduce the bug
● The expected and real behavior of the bug
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Date: 02/01/2023
1. What is the difference between String and StringBuilder in Java?
Ans: A String is immutable in Java, while a StringBuilder is mutable in Java.
An immutable object is an object whose content cannot be changed after it is created.

When we try to concatenate two Java strings, a new String object is created in the string pool.
This can be demonstrated by comparing HashCode for String object after every concat operation.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

2. Write a program for swapping two numbers without using third variable?
Ans:
public class JavaSwapNumbers {
public static void main(String args[]){
int a = 5, b = 6;
System.out.print("Before swap:\na = " + a + "\nb = " + b);
a = a + b; //a becomes 11
b = a - b; //b becomes 5
a = a - b; //a becomes 6

44 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

System.out.print("\n\nAfter swap:\na = " + a + "\nb = " + b);


}
}
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

3. Write a program to reverse string without using any function?


public class ReverseString {

public static void main(String[] args) {

String str = "Hello world";


String revString = "";

for (int i = str.length() - 1; i >= 0; --i) {


revString += str.charAt(i);
}

System.out.println(revString);
}
}
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

4. Write a program to find the common element from two arrays?


import java.util.Scanner;

public class CodeScanner


{
public static void main(String[] args)
{
int[] arrOne = new int[5];
int[] arrTwo = new int[5];
int i, j;
Scanner s = new Scanner(System.in);

System.out.print("Enter 5 elements for the first array: ");


for(i=0; i<5; i++)
arrOne[i] = s.nextInt();
System.out.print("\nEnter 5 elements for the second array: ");
for(i=0; i<5; i++)
arrTwo[i] = s.nextInt();

System.out.println("\nCommon elements are:");


for(i=0; i<5; i++)
{

45 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

for(j=0; j<5; j++)


{
if(arrOne[i]==arrTwo[j])
System.out.print(arrOne[i]+ " ");
}
}
}
}
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

5. What is the difference between = = and equals methods?


== is used to compare the reference variable of two String object & equals is used to compare the
content of two Strings object .Both returns the boolean value.

Example...
String s1="Java";
String s2="Java";
System.out.print(s1.equals(s2));//true because content is same.
System.out.print(s1.==s2);//true because both reference variable are refering to the same String.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

6. What is the difference between method overloading and method overriding?


Method Overloading
1) Method overloading is used to increase the readability of the program.
2) Method overloading is performed within class.
3) In case of method overloading, parameter must be different.
4) Method overloading is the example of compile time polymorphism.
5) In java, method overloading can't be performed by changing return type of the method only.
Return type can be same or different in method overloading. But you must have to change the
parameter.

Method Overriding
1) Method overriding is used to provide the specific implementation of the method that is already
provided by its super class.
2) Method overriding occurs in two classes that have IS-A (inheritance) relationship.
3) In case of method overriding, parameter must be same.
4) Method overriding is the example of run time polymorphism.
5) Return type must be same or covariant in method overriding.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

7. Give an example of method overloading in selenium?


This is a simple overriding example of the "findElement" method.

46 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

public static WebElement findElement(By Locator){

WebElement anElement = fluentWait.until(new Function<WebDriver, WebElement>() {


@Override
public WebElement apply(WebDriver webDriver) {
webDriver=sampleDriver;
return sampleDriver.findElement(Locator);
}
});

return anElement;
}
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

8.SQL query to fetch 2nd max salary from the table?


select
(SELECT MAX(Salary) FROM Employee) maxsalary,
(SELECT MAX(Salary) FROM Employee
WHERE Salary NOT IN (SELECT MAX(Salary) FROM Employee )) as [2nd_max_salary]
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

9.What is the difference between Array and ArrayList?


Array: A straightforward data structure with a continuous memory location, an array stores its contents
with the same name but distinct index numbers for each element of the array it contains.
It is imperative that all of the data stored in an array be of the same type. After an array has been
declared, its size cannot be changed.
Array List: The Java collection framework contains a data structure known as an ArrayList, which is
dynamic in nature.
Additionally, it has components that are of the same type. In this case, it is not necessary for us to
specify the length of the list.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

10. How to input text in the text box without sendkeys?

Selenium Automation Testing Testing Tools We can input text in the text box without the method
sendKeys with thehelp of the JavaScript Executor.
Selenium executes JavaScript commands with the help of the executeScript method. The JavaScript
command to be run is passed as parameter to the method.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

47 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

11.How to handle scroll bar using selenium?

Using Javascript executor


Basically, there are of 2 types:

Horizontal Scroll bar


Vertical Scroll bar
#1) Horizontal Scroll bar

A horizontal scroll bar lets the user scroll towards the left or right to view all the content on the window.
JavascriptExecutor js = (JavascriptExecutor)dr;
js.executeScript("window.scrollBy(0,70)");

A vertical scroll bar lets the user scroll up-down or vice versa to view the complete content on the
window.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

12. What is the return type of findElement?


Ans: driver.findelement returns WebElement
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

13. WebElement is an interface or class.


Ans: WebElement is an Interface.WebElement represents an HTML element. Generally, all interesting
operations to do with interacting with a page will be performed through this interface.
All the frequently used methods like clear(), click(), findElement, findElements(), sendKeys, getText() and
many others are associated with this interface.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

14.How to perform double click on any component?


Ans: e can perform double click on elements in Selenium with the help of Actions class.
In order to perform the double click action we will use moveToElement () method, then use doubleClick
() method.
Finally use build ().perform () to execute all the steps.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

15.What is the difference between Interface and Abstract?


Ans:
Abstract class can have abstract and non-abstract methods.Interface can have only abstract methods.
Since Java 8, it can have default and static methods also

48 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

Abstract class doesn't support multiple inheritance.Interface supports multiple inheritance.


An abstract class can be extended using keyword "extends". An interface can be implemented using
keyword "implements".
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

16.Can Interface be extended to another interface?


Ans: Yes, you can do it. An interface can extend multiple interfaces, as shown here:

interface Maininterface extends inter1, inter2, inter3 {


// methods
}
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

17. What do you mean by XPath expressions?


XPath defines a pattern or path expression to select nodes or node sets in an XML document. These
patterns are used by XSLT to perform transformations. XPath specifies seven types of nodes that can be
output of the execution of the XPath expression.

Root
Element
Text
Attribute
Comment
Processing Instruction
Namespace
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

18.What is XPath syntax?


The XPath syntax specifies the different nodes, path expressions, path notation, predicates and URLs
which are used to define the XML document.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

19.What do you mean by XPath Axes?


XPath axes are used to identify elements by their relationship like parent, child, sibling, etc. in the same
manner like path defines the location of the node.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

49 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

20.What do you understand by XPath number functions?


In XPath, number functions are used to fetch the different type of values from the expressions. For
example, ceiling value, floor value etc.

There are four types of number functions in XPath:

ceiling()
floor()
round()
sum()
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

21. How to mouse hover over a web element?


Actions class utility is used to hover over a web element in Selenium WebDriver
Instantiate Actions class.
Actions action = new Actions(driver);
In this scenario, we hover over search box of a website
actions.moveToElement(driver.findElement(By.id("id of the searchbox"))).perform();
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

22. How to take screenshots in WebDriver?


TakeScreenshot interface can be used to take screenshots in WebDriver.
getScreenshotAs() method can be used to save the screenshot
File scrFile = ((TakeScreenshot)driver).getScreenshotAs(outputType.FILE);
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

23.Is there a way to type in a textbox without using sendKeys()?


Yes! Text can be entered into a textbox using JavaScriptExecutor
JavascriptExecutor jse = (JavascriptExecutor) driver;
jse.executeScript("document.getElementById(‘email').value=“[email protected]”);
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

24.What do you mean by the assertion in Selenium?


An assertion is a method of testing whether a particular condition is true or false. In Selenium, assertions
are used to verify the state of elements on a page or the results of an action.
**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

50 QA Idea
INTERVIEW QUESTIONS BY QA IDEA

**********************************************************************************
To Get Daily QA Job Alerts, Join Our WhatsApp / Telegram Group.
*******************************************************************************************

Online Selenium Automation Training:-


Start Date: - 09th January 2023

☸ Course Contents:-
Java, Selenium, TestNG, Maven, Git, Jenkins, BDD Cucumber, Selenium Grid, Page Object
Model, HTML, JavaScript, AutoIT, Log4j, Assertion, Project Explanation, Manual Testing, Agile,
JIRA, API Testing, etc.

✔Transposed 10000+ People into Automation across the World.


✔Customized Notes on All Topics.
✔Concept Retention with Funny Example.
✔In Depth Interview Preparation with Dedicated Sessions, Resume Writing Assistance and Much
More.

☑ First 4 sessions are free. ☑

✔Duration:- 3 Months
✔Monday to Thursday: - 2 Hours
✔Timing:- 9.30 PM to 11.30 PM IST
✔Fees:- 7000/-
✔Mode of Training: - Online

Click here to join Online Selenium Training : - https://bit.ly/39gGfwZ

Phone / WhatsApp Details:-


-----------------------------------------
Shammi Jha: - +91-8305429370

51 QA Idea

You might also like