It is a java unit testing framework
The purpose of J unit is to write the test scripts in java programming language and scripts can be executed by default
** write a program to register and login into mail.in.com by using j unit ?
Right-click on the project àclick on new àselect J unit test cases
Give the package name as “ j unit “ & class name as “mail tag,x-right”
check the checkboxes setup() & teardown()à click on finish
Any import statements are activations
J-Unit life cycle [execution flow]:-
it contains animations like @before,@after,@test, etc.
It contains a setup method which acts as a precondition
It contains a teardown (or)shut down a method that acts as a postcondition.
It is responsible to develop the test scenario where it acts as the main method
For each and every scenario we need to develop with test animation.
when we run the script initially it invokes @before, @after, @test methods.
Inclined to build a profession as Selenium Developer? Then here is the blog post on
Selenium Training Videos.
Batch execution/suite execution:
combination of multiple test cases [scenarios]is known as a batch or test suite
Limitations of J-unit:-
It is having very limited annotations like @before class, @before, @test, @after ,after class
Test NG:-
Steps to install testing in Eclipse: Go to eclipse à click on help select install new software click on add give the name on ”Test NG” à provide URL as http://best.com/eclipse -- >click ok à check the checkbox “Test NG” click on next again next click on the radio button “I accept the license” click on finish click ok on security warning manage to click yes in restart message
Write a program to handle the pop –up in spice jet.com by using web driver with testing *
Take a Test NG class by right click on the project à click on test NG select create Test NG class Click on browse folder on the source folder expand the project and select “SRC” then click on ok Give the package name on “spice jet _ Test NG” Give the class name on “spice jet _ popup” Check the checkboxes @ before test and @ After test Click on finish
Learn more about Selenium Interview Questions in this blog post.
Test NG life cycle[execution flow] :-
It contains multiple animations like @before test, @after test, @test e.t.c
when we run the scripts initially it invokes the @before test method then executes and the @test methods in an alphabetical order finally it executes the @after test method.
once the execution is done it provides the results in two formats.
E: workspace loan selenium test. output default suite default test. Home Result o/p file [external file] XML:-
To perform the test scripts execution we are planning to use XML files.
Advantage:-
we can run the test methods in user-defined order [we can avoid alphabetical order issue]
we can perform batch execution
we can provide user-defined names to the default suite folder and default test HTML file.
How to create on XML file:
Go to file click on new select other à expand XML folder select XML file click on next select the project
Xml file Format:-
<suite name =”spicejet suite” >
<test name=”spicejet test results” >
<class>
<class name=”spicejet-testing.spicejet-popup”>
<methods>
<include name=”verifyone way search”> </include>
<include name=”verify javascripttest”></include>
</methods>
</class>
</classes>
</test>
</suite>
You liked the article?
Like : 0
Vote for difficulty
Current difficulty (Avg): Medium
1/15
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.
Stay Updated
Get stories of change makers and innovators from the startup ecosystem in your inbox