Testing - Interview Questions and Answers for 'Testing' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers - Order By Rating

   
 Q31. What are use cases?Process
Ans. It is part of the analysis of a program and describes a situation that a program might encounter and what behavior the program should exhibit in that circumstance.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     use cases   design   high level design   testing   test driven development   software system analyst   project lead      basic        frequent


 Q32. Difference between Assert and Verify ?Testing
Ans. Assert works only if assertions ( -ea ) are enabled which is not required for Verify.Assert throws an exception and hence doesn't continue with the test if assert evaluates to false whereas it's not so with Verify.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     assert   junit   mockito   verify   testing   unit testing     Asked in 5 Companies


 Q33. How should we ignore or avoid executing set of tests ?
Ans. We can remove @Test from the respective test so as to avoid its execution. Alternatively we can put @Ignore annotation on the Junit file if we want to ignore all tests in a particular file.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     junit   @test   @ignore   unit tests   unit testing   testing


 Q34. How can we test methods individually which are not visible or declared private ?
Ans. We can either increase their visibility and mark them with annotation @VisibleForTesting or can use reflection to individually test those methods.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     junit   reflection api   @visiblefortesting   white box tester


 Q35. Name few Java Mocking frameworks ?
Ans. Mockito, PowerMock, EasyMock, JMock, JMockit

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     junit   mocking frameworks   mock   architecture   white box testing


 Q36. What are the steps to be performed while coding Junit with Mocking framework ?JUnit
Ans. Initialize required objects for working with mocks and tested method
Set the mock behaviour on dependent objects
Execute the tested method
Perform assertions
Verify if a method is invoked or not

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     junit   mocking frameworks   mock   unit testing   java   white box testing  Mockito


 Q37. How to perform a clean install without executing Tests ?Maven
Ans. mvn clean install -Dmaven.test.skip=true

or

mvn install -DskipTests

or


org.apache.maven.plugins
maven-surefire-plugin

true



within parent POM file.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     maven   maven install   unit testing   unit tests


 Q38. How to access a Web Element if there are many elements with the same XPath ?
Ans. By specifying the Index like

//button[@class='button'])[2]

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     selenium   selenium webdriver   automation testing


 Q39. Which of the following annotation is used to avoid executing Junits ?

a. @explicit
b. @ignore
c. @avoid
d. @NoTest
Ans. @ignore

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   testing   junit   unit testing


 Q40. Which of the following is not the advantage of Mocking frameworks ?

a. It helps testing the module independently
b. It helps in faster unit testing
c. It helps in testing code even when external dependencies like service calls are not working
d. It helps in doing end to end Integration Testing
Ans. It helps in doing end to end Integration Testing

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     mocking frameworks   mockito   unit testing   junits


 Q41. Which of the following are usually manual ?

a. Unit Test
b. Integration Test
c. Load Test
d. Both a and c
Ans. Integration Test

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     testing   manual testing   automated testing


 Q42. Which of the following nearly involves same Test execution plan ?

a. Unit and Integration tests
b. Unit and Regression Tests
c. Integration and Performance Tests
d. Performance and Load Tests
Ans. Performance and Load Tests

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     testing


 Q43. Which of following annotation is used to initialize objects before executing set of tests ?Junit
a. @Test
b. @Ignore
c. @After
d. @Before

Ans.d. @Before

previous 30   

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: