|
INTERVIEW QUESTIONS
ACCOUNTS
DETAILS
Question: What is Annotations in TestNG? Give list of Annotations in TestNG.
Answer: Annotations in TestNG are lines of code that can control how the method below them will be executed. TestNG has also facility to pass parameters with annotations.
List of Annotations in TestNG:
1. @Test annotation describes method as a test method or part of your test.
2. @BeforeMethod Any method which is marked with @BeforeMethod annotation will be executed before each and every @test annotated method.
3. @AfterMethod Same as @BeforeMethod, If any method is annotated with @AfterMethod annotation then it will be executed after execution of each and every @test annotated method.
4. @BeforeClass Method annotated using @BeforeClass will be executed before first @Test method execution. @BeforeClass annotated method will be executed once only per class.
5.@AfterClass Same as @BeforeClass, Method annotated with @AfterClass annotation will be executed once only per class after execution of all @Test annotated methods of that class.
6. @BeforeTest @BeforeTest annotated method will be executed before the any @Test annotated method of those classes which are inside <test> tag in testng.xml file.
7. @AfterTest @AfterTest annotated method will be executed when all @Test annotated methods completes its execution of those classes which are inside <test> tag in testng.xml file.
8. @BeforeSuite Method marked with @BeforeSuite annotation will run before the all suites from test.
9. @AfterSuite @AfterSuite annotated method will start running when execution of all tests executed from current test suite.
10. @DataProvider When you use @DataProvider annotation for any method that means you are using that method as a data supplier. Configuration of @DataProvider annotated method must be like it always return Object[][] which we can use in @Test annotated method.
11. @BeforeGroups @BeforeGroups annotated method will run before the first test run of that specific group.
12. @AfterGroups @AfterGroups annotated method will run after all test methods of that group completes its execution.
13. @Parameters When you wants to pass parameters in your test methods, you need to use @Parameters annotation.
14. @Factory When you wants to execute specific group of test cases with different values, you need to use @Factory annotation. An array of class objects is returned by @Factory annotated method and those TestNG will those objects as test classes.
15. @Listeners @Listeners are used to with test class. It is helpful for logging purpose.
|
|
|
Category |
Accounts Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 8150 users |
Added on |
5/12/2016 |
Views |
66110 |
Rate it! |
|
|
Question:
What is Annotations in TestNG? Give list of Annotations in TestNG.
Answer:
Annotations in TestNG are lines of code that can control how the method below them will be executed. TestNG has also facility to pass parameters with annotations.
List of Annotations in TestNG:
1. @Test annotation describes method as a test method or part of your test.
2. @BeforeMethod Any method which is marked with @BeforeMethod annotation will be executed before each and every @test annotated method.
3. @AfterMethod Same as @BeforeMethod, If any method is annotated with @AfterMethod annotation then it will be executed after execution of each and every @test annotated method.
4. @BeforeClass Method annotated using @BeforeClass will be executed before first @Test method execution. @BeforeClass annotated method will be executed once only per class.
5.@AfterClass Same as @BeforeClass, Method annotated with @AfterClass annotation will be executed once only per class after execution of all @Test annotated methods of that class.
6. @BeforeTest @BeforeTest annotated method will be executed before the any @Test annotated method of those classes which are inside <test> tag in testng.xml file.
7. @AfterTest @AfterTest annotated method will be executed when all @Test annotated methods completes its execution of those classes which are inside <test> tag in testng.xml file.
8. @BeforeSuite Method marked with @BeforeSuite annotation will run before the all suites from test.
9. @AfterSuite @AfterSuite annotated method will start running when execution of all tests executed from current test suite.
10. @DataProvider When you use @DataProvider annotation for any method that means you are using that method as a data supplier. Configuration of @DataProvider annotated method must be like it always return Object[][] which we can use in @Test annotated method.
11. @BeforeGroups @BeforeGroups annotated method will run before the first test run of that specific group.
12. @AfterGroups @AfterGroups annotated method will run after all test methods of that group completes its execution.
13. @Parameters When you wants to pass parameters in your test methods, you need to use @Parameters annotation.
14. @Factory When you wants to execute specific group of test cases with different values, you need to use @Factory annotation. An array of class objects is returned by @Factory annotated method and those TestNG will those objects as test classes.
15. @Listeners @Listeners are used to with test class. It is helpful for logging purpose. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
Explain sequence generator in oracle ?
|
View Answer
|
|
Why we split testing into distinct stages?
|
View Answer
|
|
How can we restrict inheritance for a class so that no class can be inherited from it?
|
View Answer
|
|
What is the meaning Of Accounting
|
View Answer
|
|
why you get the error message company code is not assigned to country or the country is not assigned to calculations prodedure when you try to post a document? how do you solve it?
|
View Answer
|
|
How higher-level data is carried by IP to a destination host?
|
View Answer
|
|
What is the minimum and maximum size of an IP datagram header?
|
View Answer
|
|
What is the difference between an application server and a Web server?
|
View Answer
|
|
What are respectively some remarkable functions of myosin, CD4, albumin, keratin, immunoglobulin, reverse transcriptase, hemoglobin, and insulin?
|
View Answer
|
|
serviceconf' can be used to control xinetd managed services. A. True B. False
|
View Answer
|
|
. What are the most typical functional units of the Client/Server applications?
|
View Answer
|
|
An 8-engine Adaptive Server is undergoing a high rate of Logical I/Os and spinlock contention in the default data cache. The DBA has used Sybase ASE Monitor and has found that two 4MB tables are table-scanning within the application. This is causing 50% of the server's Logical I/Os. The code within the application cannot be changed. The task for the DBA is to increase throughput of the Adaptive Server and lower the amount of spinlock contention without changing indexes, tables or the application. Which two are valid operations which should be done to meet this objective? (Choose 2.) A. Create two named caches of 2 MB each and then recycle the Adaptive Server to activate them. B. Create two named caches of 5 MB each and then recycle the Adaptive Server to activate them. C. Create two 5MB 16KB Page Pools within the default data cache. Bind the two small tables to these page pools. D. Bind the two tables to their own newly-created and active named cache. E. Compress the tables which join to the two small tables so that they are chosen as outer tables. This will eliminate the need to table scan the small tables.
|
View Answer
|
|
Given the following statement: create index idx1 on titles(title_id) on new_segment Where: The titles table has 3 partitions The target segment new_segment spans 10 devices The max parallel degree parameter is 25 If available worker processes at runtime is 5, what is the total number of producers used for the parallel sort? A. 10 B. 3 C. 25 D. 1
|
View Answer
|
|
A strong name consists of the assembly's identity its simple text name, version number, and culture information (if provided) plus a public key and a digital signature. It is generated from an assembly file (the file that contains the assembly manifest, which in turn contains the names and hashes of all the files that make up the assembly), using the corresponding private key. Assemblies with the same strong name are expected to be identical.
Strong names guarantee name uniqueness by relying on unique key pairs. No one can generate the same assembly name that you can, because an assembly generated with one private key has a different name than an assembly generated with another private key.
When you reference a strong-named assembly, you expect to get certain benefits, such as versioning and naming protection. If the strong-named assembly then references an assembly with a simple name, which does not have these benefits, you lose the benefits you would derive from using a strong-named assembly and revert to DLL conflicts. Therefore, strong-named assemblies can only reference other strong-named assemblies.
There are two ways to sign an assembly with a strong name:
1. Using the Assembly Linker (Al.exe) provided by the .NET Framework SDK. 2. Using assembly attributes to insert the strong name information in your code. You can use either the AssemblyKeyFileAttribute or the AssemblyKeyNameAttribute, depending
T
|
View Answer
|
|
ABO and rhesus (Rh) system, the second rhesus positive baby of a Rh negativemother is at a greater risk than the first
|
View Answer
|
|
The epidermal and dermal epithelia grow downwards along the suture track. Question Published at Wednesday, 01 July 2009 in Category Pathology. Question Visited: 368 Times.
Answer of Selected Question
Answer:
* Collapse/Expand Answer of Question The epidermal and dermal epithelia grow downwards along the suture track.
True
Do you have any collection of Interview Questions and interested to share with us!! Please send that collection to [email protected] along with the category and sub category information
* StumbleUpon * Digg * Delicious * Twitter * FaceBook * LinkedIn * Google * Yahoo * MySpace * Tell Your Friend
The epidermal and dermal epithelia grow downwards along the suture track.
Previous Interview Question Next Interview Question Monocytes clean the debris left by phagocytes. Fibroblasts have a contractile function, which helps to produce a small scar.
« previous123456789...3334next » Appropriate Answers of the selected Question [ The epidermal and dermal epithelia grow downwards along the suture track. ] from category Pathology...
Do you find this Answer incorrect or incomplete? Please e-mail us or place your comment or if you have correct answer then place in comment regarding this question "The epidermal and dermal epithelia grow downwards along the suture track." To ensure quality, each change is checked by our team, before it enters the main website database. If you desire so, the chang
|
View Answer
|
|
What is the difference of Cost Accounting and Financial Accounting?
|
View Answer
|
|
Does the accounting system appear to facilitate one specialty from financial, auditing, or cost managerial or tax accounting over the others?
|
View Answer
|
|
What are the effects of international accounting standards on accounting practices of developing nations?
|
View Answer
|
|
Where the financial accounting fails the cost accounting for is rescue but still there are some limitations deficiencies in the system?
|
View Answer
|