Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

1 like 0 dislike
661 views
by
I am going to give a selenium interview. Can you share interview questions for selenium?

3 Answers

0 like 0 dislike
by Master (1.2k points)
edited by

Sample interview questions for automation
1. What is Explicit wait and Implicit wait?
2. What is a headless browser?
3. How to get a screenshot in Selenium? Can you write the syntax?
4. What are the different type of Locators in Selenium?
5. What is the best way to locate a web element if there is no unique XPath?
6. What is StaleElementReference Exception? Have you encountered it ever and how you handled it?
7. Do you run test cases in parallel with TestNG? If yes how many threads and does it cause any problem?
8. What is the most common locator you use in your project?
9. Have you ever done profiling of a web page?
10. How frequently you use Thread.Sleep()?
11. Suppose there are two elements on a web page with same ids, how will you handle it?
12. Can we create an object for an interface?
13. Difference between @BeforeTest and @BeforeMethod in TestNG?
14. How does Selenium interact with the Web browser?
15. Can you make the constructor of a class static?
16. How do you maintain your test scripts and how frequently you have to modify them?
17. How to find all broken links on a webpage?
18. Explain your Automation Framework.
19. Write a dynamic XPath to locate a table's 2nd row 3rd column data.
20. Hash map vs Hash table.
21. What is the significance of hash table?
22. What is the return type of findElements?
23. What's the difference between a Maven project and a Java project?
24. Getwindowhandle vs Getwindowhandles and the return types.
25. Comparable vs comparator.
26. Explain about the Project along with how the Automation was done.
27. How to upload a file in Selenium?
28. How to upload a file without using Sendkeys?
29. How to connect to a Database using Selenium?
30. Any idea or experience with Continous Integration tool?
31. How to handle a drop-down in Selenium?
32. What is WebDriver interface?
33. Why do we need Interface in the test?
34. How to integrate your test with Jenkins?
35. Any example or practical usage of Run time polymorphism?
36. How to find dynamic elements?
37. What is the difference between CSS selector and XPath? Which is better from a performance perspective?
38. Difference between Instantiate and Initialize in Java.
39. What is mean by fluent wait?
40. What kind of framework have you made?
41. What's TestNG Listener Class & why do we use it?
42. Any idea about the Selenium Grid? Or Parallel execution.
43. What are the challenges you face when running automation scripts?
44. Difference between == and =.
45. What's Page Factory?
46. How to click a button without using click() and without using CSS & XPath selectors?
47. Are multiple inheritances possible in Java? Why?
48. Are all methods in an abstract class, abstract?
49. Can we make an Object of Abstract class or an Interface?
50. What's the difference between method overloading and overriding?
51. What's the use of Java Static keyword?
52. Different type of polymorphism.
53. Can we write webdriver dr = new webdriver();
54. What are the different plugins used for Maven? And it’s use?
55. Difference between Abstract and Interface?
56. Try, Throw & Catch syntax. And why is it used?
57. How do you manage to re-run only failed test cases?
58. How to make TestNG.xml at run-time?
59. What's a Singleton class?
60. Can we have Finally block without Try & Catch blocks?

Please find below some real-interview Qs related to Selenium

1. What is Explicit wait and Implicit wait?
2. What is a headless browser?
3. How to get a screenshot in Selenium? Can you write the syntax?
4. What are the different type of Locators in Selenium?
5. What is the best way to locate a web element if there is no unique XPath?
6. What is StaleElementReference Exception? Have you encountered it ever and how you handled it?
7. Do you run test cases in parallel with TestNG? If yes how many threads and does it cause any problem?
8. What is the most common locator you use in your project?
9. Have you ever done profiling of a web page?
10. How frequently you use Thread.Sleep()?
11. Suppose there are two elements on a web page with same ids, how will you handle it?
12. Can we create an object for an interface?
13. Difference between @BeforeTest and @BeforeMethod in TestNG?
14. How does Selenium interact with the Web browser?
15. Can you make the constructor of a class static?
16. How do you maintain your test scripts and how frequently you have to modify them?
17. How to find all broken links on a webpage?
18. Explain your Automation Framework.
19. Write a dynamic XPath to locate a table's 2nd row 3rd column data.
20. Hash map vs Hash table.
21. What is the significance of the hash table?
22. What is the return type of findElements?
23. What's the difference between a Maven project and a Java project?
24. Getwindowhandle vs Getwindowhandles and the return types.
25. Comparable vs comparator.
26. Explain about the Project along with how the Automation was done.
27. How to upload a file in Selenium?
28. How to upload a file without using Sendkeys?
29. How to connect to a Database using Selenium?
30. Any idea or experience with Continous Integration tool?
31. How to handle a drop-down in Selenium?
32. What is WebDriver interface?
33. Why do we need Interface in the test?
34. How to integrate your test with Jenkins?
35. Any example or practical usage of Run time polymorphism?
36. How to find dynamic elements?
37. What is the difference between CSS selector and XPath? Which is better from a performance perspective?
38. Difference between Instantiate and Initialize in Java.
39. What is mean by fluent wait?
40. What kind of framework have you made?
41. What's TestNG Listener Class & why do we use it?
42. Any idea about the Selenium Grid? Or Parallel execution.
43. What are the challenges you face when running automation scripts?
44. Difference between == and =.
45. What's Page Factory?
46. How to click a button without using click() and without using CSS & XPath selectors?
47. Are multiple inheritances possible in Java? Why?
48. Are all methods in an abstract class, abstract?
49. Can we make an Object of Abstract class or an Interface?
50. What's the difference between method overloading and overriding?
51. What's the use of Java Static keyword?
52. Different type of polymorphism.
53. Can we write webdriver dr = new webdriver();
54. What are the different plugins used for Maven? And it's use?
55. Difference between Abstract and Interface?
56. Try, Throw & Catch syntax. And why is it used?
57. How do you manage to re-run only failed test cases?
58. How to make TestNG.xml at run-time?
59. What's a Singleton class?
60. Can we have Finally block without Try & Catch blocks?
61. Use of Super and This keyword in Java.
62. What's Data binding?
63. What's the difference between Final, Finally and Finalize?
64. Difference between Absolute and Relative XPath? Which is faster?
65. How to execute a Java program from the command prompt?
66. What is Continuous Integration?
67. What is the return type of DataProvider?
68. What's the Maven Life cycle?
69. What's the difference between plug-ins and dependencies?
70. How to make a class as immutable?

Programs

71. Java Program: Change a string such that first character is upper case, second is lower case and so on.
72. Java Program: To find duplicates between two lists.
73. WAP to compare two Hashmap for equality?
74. Java Program: Sort a string which has only 0, 1, 2 in it

src: Not sure :) Somewhere from the internet

Get more questions at https://softwaretestingboard.com/q2a/tag/interview-questions

0 like 0 dislike
by The go-to Tester (142 points)
How can you get the element with XPath? (they show you HTML page)
0 like 0 dislike
by The go-to Tester (173 points)
Try to focus on basics. They are mainly focus on #Framework, #Coding in automation, How you design your frame work in current project (If showing some).


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...