Real Time Automation Interview Questions - Part 3

In continuation with the latest series of Real Time Automation Interview Questions, we present you the part 3 of the course structure. Click on below links for part 1 and 2.


Real Time Automation Interview Questions - Part 3

  • Tell me the difference between Implicit and Explicit Wait?
    • Implicit wait applies for all the elements and all the tests like if we give 10 sec of implicit wait it will wait for 10 sec for each element before giving nosuchelement exceptions. 
    • While Explicit wait can be applied for any particular step for which you want extra wait time so we can use explicit wait. 
    • We can use mix of both waits to depend on the situation of the step Link : https://www.guru99.com/implicit-explicit-waits-selenium.html
  • Can you tell me some exceptions in Selenium?
  • What do you mean by user defined Exception?
    • User Defined Exception or custom exception is creating your own exception class and throws that exception using 'throw' keyword. 
    • This can be done by extending the class Exception. ... The keyword “throw” is used to create a new Exception and throw it to the catch block
  • Can you tell me what is Assert in TestNG?
    • Assert is like verification where we check like expected thing and actual thing are same or not.
  • Which Assert you have used in TestNG?
    • We have used Hard assert and Soft assert, while applying Hard assert if we found any glitch in expected and actual then it will through exception and move to next @test 
    • while Soft assert it won’t give exception and move to next step of that test. And to get all the exceptions in console we need to write at the end assert.all().
  • Can you tell me about the order of testNG annotations?
    • @BeforeSuite 
      • @BeforeTest 
        • @BeforeClass 
          • @BeforeMethod 
            • @Test 
          • @AfterMethod 
        • @AfterClass 
      • @AfterTest 
    • @AfterSuite
  • Have you heard that priority can be set as -ve in TestNG?
    • Yes, like priority is 0, -1, TestNg will run -1 then 0 then 1. 
    • And if we have any @test which is not having any priority set, then in that case it will search via alphabetic order whichever comes first and execute test respectively.
  • Can you explain me TestNG?
    • TestNG is advanced version of Junit only. It is mainly used by Dev/QA for maintain the code easily and for unit testing. 
    • It provides lots of benefits to us like we can create a suite and we can write all the required Tc in one go only using that suite. We can group our Tc we can set priority we can run our tc in parallel mode, We can generate good reports via TestNG. 
    • We can write functionality depends on methods, depends on group. We can run single tc multiple time with single set of data or multiple set of Data.
  • How to run single method multiple time in testNG?
    • We have invocation count attribute in @test annotiation. We can write invocation count as 3 if we want to run it 3 times. Apart from that we can write threadpull.size if we want to run that case in multiple thread. 
    • Links : https://www.inviul.com/run-same-test-multiple-times/
  • Have you worked in Cucumber, what all files are required in cucumber?
    • In cucumber we have Feature file, Step Definition file and Test Runner file. 
    •  In feature file we used to write scenario in gherkin language which is most like in plain English language. Here we use some of the keywords like feature, scenario, scenario outline, given, when, then, and, example, background keywords for writing our test scenarios steps. In Step Definition file we write mapping code for all the scenario of feature file. In test Runner file we provide the address of the feature file, step definition file, and all-important Tags, Plugin, Listeners in that.

Comments

Popular posts from this blog

Azure Tutorials Series - Azure Networking

Coforge Interview Questions | Automation Testing profile

Testing in CI/CD