The document contains a comprehensive list of 94 interview questions related to TestNG, covering various topics such as basic concepts, XML configuration, annotations, reporting, grouping, assertions, dependencies, and advanced usage. It serves as a resource for individuals preparing for TestNG-related interviews, providing insights into the framework's functionality and best practices. Questions range from fundamental definitions to more complex scenarios involving data-driven testing and parallel execution.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
21 views1 page
94 TestNG Interview Questions
The document contains a comprehensive list of 94 interview questions related to TestNG, covering various topics such as basic concepts, XML configuration, annotations, reporting, grouping, assertions, dependencies, and advanced usage. It serves as a resource for individuals preparing for TestNG-related interviews, providing insights into the framework's functionality and best practices. Questions range from fundamental definitions to more complex scenarios involving data-driven testing and parallel execution.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
94 TestNG Interview Questions
Basic Interview Questions on TestNG
1. What is the TestNG Framework? 2. How do you run the TestNG script? 3. What are the advantages of TestNG? 4. What is the difference between a TestNG test and a TestNG test suite? 5. What are some advantages of TestNG over JUnit? 6. Why do we need TestNG in Selenium? 7. What are the basic steps required in writing the TestNG test? 8. What is the difference between Suite, Test, and Class? 9. How will you execute methods or test cases in TestNG in a different order/your order? TestNG Interview questions on TestNG XML 10. Define the correct order of tags in the TestNG XML file. 11. Why do we create the XML file in TestNG? 12. Write the code snipped for passing values 1 and 2 to the parameters val1 and val2 through the XML file. 13. Can you arrange the below testng.xml tags from parent to child? 15. What is the use of the preserve-order attribute in the TestNG XML file? 16. How to Integrate TestNG XML with Maven? 17. How to pass the parameter in the test case through the testng.xml file? 18. How to create an XML file in TestNG? 19. How to write regular expressions In testng.xml file to search @Test methods containing the “smoke” keyword. Annotation related TestNG Interview Questions 20. What are the types of annotations used in TestNG (In the sequence of execution/hierarchy)? 21. What are the categories of annotations in TestNG? 22. What is @Factory annotation in TestNG? 23. What is the difference between @Factory and @Dataprovider annotations? 22. How do you implement Mocha tests for non-functional requirements such as scalability, reliability, and usability? 23. What is the difference between @Factory and @Dataprovider annotations? 24. What is the use of @Listener annotation in TestNG? 25. What is the sequence of execution of the annotations in TestNG? 26. What are the attributes supported by @Test annotation in TestNG? 27. Which attribute is used to run the test method always? 28. Which attribute is used to provide data to test method in Data-driven testing? 29. What is the use of the dependsOnMethods attribute in TestNG? 30. What is the use of dependsOnGroups attribute in TestNG? 31. What is the difference between @BeforeTest and @BeforeMethod annotation? 32. How will you make test cases dependent on each other? Report related TestNG interview questions 33. What are the types of reports generated in TestNG by default? 34. What are the different ways to produce reports for TestNG results? 35. Where is the emailable report generated and saved in TestNG? 36. Where is the index report generated and saved in TestNG? 37. How to use TestNG Reporter Class for the log generation? 38. What do we need to generate a customized report in TestNg 39. How to share the project report using TestNG? Grouping related TestNG interview questions 40. What is the importance of groups in TestNG? 41. Define grouping in TestNG? 42. How do you define groups in TestNG? 43. How do you exclude a group from the test execution cycle? 44. How to create a Group of Groups in TestNG? 45. How to group multiple test methods in a single group using TestNG? 46. How do group multiple test methods in multiple groups? 47. How to group multiple test methods with Priority? 48. What are Inclusion & Exclusion Groups in TestNG? 49. When do we use "dependsOnGroups" in TestNG? Assertion related interview Questions for TestNG 50. What do you understand by asserting in TestNG? 51. Describe any five common TestNG assertions 52. What are the different types of assert in TestNG? 53. Define soft assert in TestNG and describe how they are different from hard assert Dependency-related interview questions for TestNG 54. What is meant by dependency in TestNG? 55. How do you create dependencies in TestNG? 56. How do you create dependency through the XML file? 57. How TestNG allows to declare dependencies? 58. How many types of dependencies can you achieve by using TestNG? Micillenious Interview questions for TestNG 59. What are the priorities in TestNG? 60. How to set priorities in TestNG? 61. What is parameterization in TestNG? 62. What are the optional parameters in TestNG? 63. What is the significance of "timeout" in TestNG? 64. What is meant by invocationCount in TestNG? 65. What is meant by parallel test execution in TestNG? 66. On what levels can we apply parallel testing in TestNG? 67. How is exception handling done in TestNG? 68. Can we disable a test in TestNG? If so, explain how? 69. Why is the reporter class used in TestNG? 70. Define the syntax for generating logs through the reporter class in TestNG 71. What are listeners in TestNG? 72. How to declare listeners in TestNG? 73. What are the different listeners TestNG provides? 74. How to Implement TestNG iAnnotationtransformer ? 75. What is the default value for the TestNG Priority? 76. How to achieve TestNG itestlistener implementation? 77. What is an exception test in TestNG? 78. How will you install TestNG in Eclipse? 79. How to throw a SKIP Exception in TestNG? 80. How to Ignore a test case in TestNG? 81. What is the time unit we specify in test suites and test cases? 82. List out various ways in which TestNG can be invoked? TestNG Interview questions for experienced 83. How can we create a data-driven framework using TestNG? 84. How to exclude a particular test method from a test case execution? 85. How to skip a @Test method from execution in TestNG? 86. How To Run TestNG Using Command Prompt? 87. What is the use of @Test(threadPoolSize=x)? 88. What is the use of @Test(invocationCount=x)? 89. What is the thread count in TestNG? 90. What is verbose in TestNG? 91. How many ways by which can we pass parameter values to test methods? 92. How do you use TestNG to test RESTful web services? 93. How do you use TestNG to test mobile applications? 94. How to implement Data providers in TestNG?