Common test automation interview questions & topics one can expect for 5+ years experience
****************
*******
Java-Basic
*******
1. Types of polymorphism
2. Difference between override and overload
3. Methods that cannot be overloaded
4. Static block and instance block
5. Difference in Static and non static
6. Encapsulation and common use cases
7. Abstract vs interfaces
8. Inheritance in java
9. Methods that cannot be overloaded
10. Type casting in java
11. String buffer and string builder
12. Why string is immutable in java
13. How to handle exceptions
14. Can I write try catch without the catch block
15. Difference between throws and throw
16. Use of iterator in java
17. Difference in Final, finally and finalize
18. Boxing and unboxing in java
19. Increment and decrement operation
20. Variable Args
21. This and super keyword in java
22. Issues during Swtich case without break
23. Upcasting and downcasting
24. Baseclass of all class in java
25. Baseclass of error and exceptions
26. Access specifiers
27. Continue and break statement
28. Can main method return any value
29. Can we overload main method. What happens when overloaded
30.how to execute and statement before main method
31. Difference between == and equals()
32. Can user declare constructor as final
33. Can we cast any other type to Boolean data with type casting.
34.does java compile if user use 'static public void' instead of 'public static void'
35.can we use this() and super() in a constructor
36. Can we create object of abstract class
37. Can we create reference for an abstract class
38. Can we declare a class as static
39. What is instanceOf keyword
40. What's the load factor of HashMap
41. How to prevent a class from being sub classes
42. Final variable, final method and final class
43. Ways to create a string variable.
44. What is gc() - garbage collector
45. Subclass and innerclass
46. Infinite loop in java
47. How to make copy of an element
48. Checked and unchecked exceptions
*******
Java Collection
*******
1. Classes inside List interface, Set interface, Map Interface
2. Arraylist vs Linkedlist
3. Arraylist vs array
4. Arraylist vs vector or stack
5. Which class of List Interface to be used if user have more insertions and deletions
6. Which class of List Interface to be used if user have more retrieval
7. Set Interface: HashSet, TreeSet, SortedSet
8. Map - HashMap, HashTable, TreeMap, LinkedHashMap.
9. Stack and Queue
10. How to maintain insertion order in Set, List and Map
11. How to sort elements in ascending order in Set and Map
*******
Java Programs
*******
1. String reverse
2. String Palindrome
3. String Anagram
4. Find occurrences of characters in a string
5. Find the count of Capital and Small letters in a string
6. Remove duplicate characters from string
7. Swap to numbers without temporary variable
8. Reverse number
9. factorial
10. Fibonacci
11. Count number, alphabet and special characters
12; Print the below format
input String str="My name is Ramesh ch";
you should print the output:
Ramesh ch name is My
13)Print occurrence of each character in given string and also remove duplicates and print the string
String str="aaaabcccpqvswweeee"
1)output
a=4
b=1
c=3
p=1 q=1v=1w=2 e=4 s=1
2)after removing duplicates output string
abcpqvswe
14)Write a program for method overloading and method overriding ?
*******
Selenium
*******
1. Difference in driver.get() and driver.navigate().to()
2. Navigation methods in selenium
3. What is POM
4. Implicit wait
5. Explicit wait- use of explicit wait, how to ignore exceptions using explicit wait
6. Fluent wait
7. Examples for expected conditions in explicit wait
8. Default timeout of pageLoadTimeout.
9. Use of desired capabilities
10. Use of chromeOptions, firefoxOptions ,ieOptions, etc.
11. How to disable notification in selenium.
12. Difference between getText() and getAttribute()
13. How to extract css property value
14. Difference between driver.close() and driver.quit()
15. How to handle dropdown elements with select tag and without select tag.
16. How to handle frames and windows
17. How to switch back to parent window.
18. How to perform page scroll in selenium
19. Use of Robot keys
20. Use of AutoIt
21. Use of Sikuli
22. How to perform File Upload
23. How to click or send value to an element without using element.click() and element.sendKeys()
24. Relative and absolute xpath
25. Explain few Xpath functions
26. How to login to site showing authentication popup in selenium
27. Mention few selenium exceptions
28. Difference between single slash and double slash.
29. What are the scenarios that cannot be automated using selenium.
30. How to perform right click on selenium
31. Action class and it's methods
32. Use of HtmlUnit driver
33. Can we create an object of the WebDriver() in selenium?
34. What is stale element exception and how to handle it.
35. Xpath and CSS selector
*******
TestNG
********
1. Annotations in testng
2. Difference between @BeforeTest and @BeforeMethod
3. Soft assert vs Hard Assert
4. How to pass parameters to test methods
5. Use of data provider
6. Use of invocationCount, enabled, priority, dependsOnMethod, dependsOnGroups, alwaysRun, dataProvider, groups, timeout, expectedExceptions, singleThreaded, etc
7. testNg xml structure
8. How to group testcases
9. Use of IRetryAnalyzer class
10. How to run failed testcases
11. How to perform parallel testing.
12. What level user can perform parallel testing
13. Use of ISuiteListener Methods
14. Use of TestListenerAdaptor methods
15. How to ignore packages and classes.
16. Can user provide negative value for setting priority.
*******
REST API
*******
1. Client/server Error Codes
2. Success codes
3. Use of GET, PUT, POST, PATCH, DELETE
4. Difference between Put and Patch
5. Difference between Put and Post
6. How to handle authentication
7. Difference between webserver and API
8. Json/xml structure format
9. How to validate json response
10. Use of JsonPath
11. How to construct json body for Put, Post, Patch request.
12. Use of JsonObject.
13. What's is URI
14. What's a resource
15. What are the common headers used.
16. Common content types
*******
GIT
*******
1. Use of common commands used:
add, status, commit, push, pull, restore, checkout, clone
2. How to handle merge conflicts
3. How merge issues occur.
*******
Cucumber
*******
1. keywords used inside CucumberOptions
2. Difference between DryRun and Strict in cucumberOptions
3. And/OR operation in Tags
4. Annotations in Cucumber
5. Use of order function inside cucumber annotations
6. Use of background keyword
7. Keywords used in cucumber
8. How to perform singleline and multiline comment in cucumber
9. How data is passed in cucumber
10. Use of ScenarioOutline and example
11. What is dataTable
12. Can user provide multiple examples for one scenario outline
****************
Hoping that the above mentioned topics and questions will helps you to clear your interviews.
All the best for your job hunt👍
Have a good day.