Sunday, 28 April 2024

Complete Interview experience from one of the organization.

 Complete Interview experience from one of the organization. Those planning to switch can go through this

1st round:
o  Diff between page object and page factory?
o  What is data driven testing?
o  Diff between abstract class and interface?
o  Singleton dsgn pattern?
o  Explain framework?
o  How u estimate ur work?
o  static and dynamic binding
o  Stale element exception?
o  Desired capability?
o  Diff between hashmap and hashset
o  How u integrate rest assured with project?
o  Approach and types of testing performed by u on API testing?

2nd Round:
o  Basic intro
o  Background in cucumber
o  What all is included in runner class in cucumber
o  How u implemented listeners in ur framework
o  Explain interface in ur framework perspective not definition
o  How many listener interfaces u r using
o  How u use loggers in ur project for debugging
o  Is there any log listeners in ur framework? If not can u use it?
o  What is constructor?
o  Can we have more than one constructor in a class?
o  In default constructor can u initialize variables even without passing parameters?
o  What exceptions can occur in selenium and that u have seen in project.
o  What is stale element exception. Then what is timeout exception?
o  How u setup environment in postman
o  How u store a response of one request and use same response in another request in postman
o  Diff between 200 and 201.
o  If u create any resource u get 201. But sometime we get 200 as well as for successful response. How will u verify this 200 is coming instead of 201, if it’s a bug?
o  How u r storing url of ur application in framework
o  Suppose u have 50 apis in config out of which 48 are common to dev and test env but 2 are diff in both. How u handle this in framework.

3rd round: Managerial

o  Tell me about yourself
o  How many frameworks have you worked on till now?
o  Tell me something about TestNG that you liked?
o  Do you use maven project and if yes why?
o  Tell me about cucumber and why you are not using cucumber in your project. Explain properly with valid points
o  Tell cucumber features
o  Given an api to fetch user details by sending empId in request what can be the possible test cases. Can you write some cases?
o  Suppose your org has some QAs and they have all manual test cases available with them. Now you want to hire someone to automate your testcases. From your end what automation tool will you suggest and why? How will you estimate time for all these scenarios to automate? What can be the risks involved in above scenarios? Can you name some of them?
o  How many project time estimates do you know?
o  In recent time any accomplishment did you receive from employee that does not belongs to your team? How you helped them?
o  Are you willing to relocate?
o  Do you have any questions to me?
o  At the end one program was given to identify if a given number is prime or not. The task was to reduce the time complexity of given code.

Thursday, 1 February 2024

 TestNG Questions and Answers (Part-1):

1. What is the importance of the TestNG framework?
- TestNG is important for test automation because it provides a powerful framework for writing and running test cases.
- It allows you to define test suites, run tests in parallel, and provide detailed reporting.

2. Why do we use TestNG in your framework?
- TestNG is used for its flexibility and features like test grouping, parallel test execution, and comprehensive reporting.

3. What is the purpose of testing XML?
- TestNG XML files are used to configure and organize test suites, set parameters, and define test dependencies.

4. Explain the purpose of listeners, and is it a Selenium concept or a TestNG concept?
- Listeners are part of TestNG, not Selenium. 
- They allow you to customize test execution and capture events such as test success or failure. 
- Listeners are used for tasks like logging, reporting, and taking screenshots.

5. Case Scenario: How to run the same method 100 times in TestNG with the same data?
- You can use the @DataProvider and invocationCount attributes to run the same test method with the same data multiple times.

6. What is the reporting tool in your framework, and why do you use it?
- Reporting tools like ExtentReports or Allure are often used in conjunction with TestNG to generate detailed and user-friendly test reports. 
- These tools make it easier to understand test results.

7. What are different TestNG annotations?
Common TestNG annotations include 
- @Test, 
- @BeforeMethod, 
- @AfterMethod, 
- @BeforeTest, 
- @AfterTest, 
- @BeforeClass, 
- @AfterClass, 
- @BeforeSuite, 
- @AfterSuite. 
Each serves a specific purpose in test execution.

8. How can you configure tests in TestNG?
- Tests are configured in TestNG XML files where you define suites, tests, classes, methods, parameters, and data providers.

9. What is @DataProvider?
- @DataProvider is a TestNG annotation used to provide data to test methods. 
- It allows you to separate test data from test logic.

10. Difference between @Factory and @DataProvider.
- @Factory is used to run multiple test classes, 
- @DataProvider is used to supply data to a test method. 
- They serve different purposes.
- @Factory is used to run the same test class multiple times with different data sets. 
For example, if you have a test class MyTest and you want to run it with different data sets, you can create a factory 
method to instantiate it multiple times with different data.