There are no items in your cart
Add More
Add More
| Item Details | Price | ||
|---|---|---|---|
Learn all the frequently asked interview questions on automation testing
1. What is the final keyword in Java?. Can we apply it to class and methods?
2. What is static keyword in Java?. Why it is used?
3. What is an interface and when do we use it?
4. What is an abstract class and why do we use it?
5. Write a Java program to filter out duplicate values in a list
public class FilterDuplicateValuesInList {
public static void main(String[] args) {
List<String> values = new ArrayList<>();
values.add("Java");
values.add(".Net");
values.add("Python");
values.add("Java");
values.add("Python");
Set<String> removeDuplicates = new HashSet<>();
removeDuplicates.addAll(values);
for(String s: removeDuplicates){
System.out.println(s);
}
}
}6. What is an Automation Framework?
7. Explain the different features of your Automation Framework
8. How do you handle different test environments within your Automation Framework?. Write sample code
public class ReadPropertiesFile {
public static void main(String[] args) {
File file = new File("src/resources/Application.properties");
try {
FileInputStream fis = new FileInputStream(file);
Properties props = new Properties();
props.load(fis);
String devUrl = props.getProperty("dev.url");
String stagingUrl = props.getProperty("staging.url");
System.out.println("Application DEV URL is: " + devUrl);
System.out.println("Application Staging URL is: " + stagingUrl);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}9. What are the different design patterns in Java?. Give an example of a design pattern used in your Automation Framework
Some of the design patterns are:
We have used the Singleton design pattern to initialize the browser driver. This is to make sure only one driver instance exists at all times. Singleton class contains a private constructor and a static method that has return type object of the singleton class.
public class SingletonClass {
private static SingletonClass instance = null;
private SingletonClass(){
}
public static SingletonClass getInstance(){
if(instance==null){
instance=new SingletonClass();
}
return instance;
}
}
10. How have you implemented Abstraction in your Automation Framework?

Bijan Patel
Full Stack Test Automation Expert | Selenium Framework Developer | Certified Tosca Automation Specialist | Postman | DevOps | AWS | IC Agile Certified | Trainer | Youtuber | Blogger|