When we create our Selenium tests in Java normally we use JUnit or TestNG frameworks to execute our test scripts. We can also use FitNesse tool as a framework for our Selenium tests. FitNesse can be used when we have the below scenarios:
You might have this question running in your mind!! Can't we use JUnit or TestNG to achieve the above things. Answer to this question will be, YES, we can use. But, we need to go for the concepts like Data Providers and JXL (Read data from Excel sheet) while using JUnit or TestNG.
When we use FitNesse, we can simply achieve the above things without Data Provider and JXL. Also, we doesn't require any technical person to execute our scripts. Once the test scripts are configured with FitNesse, any one can execute the scripts from there.
Just to give a try, follow these steps:
- When we need to pass number of parameters to the script
- When we need to run the same script with different parameters
- When we need to run the same script with different URLs as parameters (functionality will be same).
You might have this question running in your mind!! Can't we use JUnit or TestNG to achieve the above things. Answer to this question will be, YES, we can use. But, we need to go for the concepts like Data Providers and JXL (Read data from Excel sheet) while using JUnit or TestNG.
When we use FitNesse, we can simply achieve the above things without Data Provider and JXL. Also, we doesn't require any technical person to execute our scripts. Once the test scripts are configured with FitNesse, any one can execute the scripts from there.
Just to give a try, follow these steps:
- Download FitNesse from here.
- Once its downloaded, create a folder called FitNesse in C or D drive and move the downloaded file(fitnesse.jar) into this folder.
- Go to command prompt and open this folder C:\FitNesse
- Type java -jar fitnesse.jar and press enter. FitNesse jar file will be unpacked and you will find a additional folder called FitNesseRoot which will be having all the supporting files
- Again type java -jar fitnesse.jar and press enter. This time your FitNesse server will be started. If it ask you to choose the different port, use -p argument with the above command: java -jar fitnesse.jar -p 8081
- Now open your browser and go to http://localhost. You will see the FitNesse environment.
- You will see some introduction notes on the home page. Click on Edit from left navigation and remove all the notes and configure your Java test scripts and jar files. You need to include the below things:
- !contents
- !path C:\Fitnesse\FitNesseRoot\files\classes
- !path C:\Fitnesse\lib\*.jar
- Make sure you have created the folder called "classes" under C:\Fitnesse\FitNesseRoot\files location and included all your test scripts (Java class files). Also make sure you have created lib folder under C:\FitNesse and included all the necessary jar files: FitNesse.jar, selenium-java-client-driver-2.x.jar, selenium-server-standalone.jar
- Once you have configured your test scripts and jar files, click on save to update the changes. Now you can only see your test script and jar file configuration paths on your FitNesse home page. Whenever you open FitNesse, you will see this path.
- Now click on Add Child on the top of the home page to create a Test Suite and Test and enter a name. Make sure you have minimum two words in the name and each word should start with capital letter. For Example, TestSuite - SampleSuite and Test - SearchCheck.
- Now you can see your suite on the home page. Click on that, you will find your Test. When you open that, you will get Edit option in the left navigation. Click on that and call your test script. Follow the below format:
- !|package name.class name|
- |parameter name|method name|
- |parameter value|Expected Outcome|
- For Example, if you have created a class SampleClass under the package Sample in Java. Assume that you have a test method "firstMethod()" and a parameter "searchString"
- !|Sample.SampleClass|
- |searchString|firstMethod()?|
- |Sachin|True|
- Remember that we are passing the value for the variable searchString from FitNesse, but the variable should be declared in your java code.
- If you want to pass number of parameters, you need to include as follows:
- !|Sample.SampleClass|
- |searchString|firstMethod()?|
- |Sachin|True|
- |Yuvraj|True|
- |Dravid|True|
- |Dhoni|True|
- After adding all your parameters, save the changes and click on Test on the left navigation. But, make sure you test script is created and the class file has been stored in this location: C:\Fitnesse\FitNesseRoot\files\classes
- I have created a test script with Same class and test method. You can try this example:
package Sample;
import com.thoughtworks.selenium.DefaultSelenium;
import fit.ColumnFixture;
public class SampleClass extends ColumnFixture {
public DefaultSelenium selenium;
public String searchString;
public SampleClass()
{
selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.google.com/");
selenium.start();
}
public boolean firstMethod() throws Exception
{
selenium.open("/");
selenium.waitForPageToLoad("30000");
selenium.type("name=q", searchString);
selenium.click("btnG");
Thread.sleep(5000);
return selenium.isTextPresent("News for "+searchString);
}
}
Screenshot of FitNesse test environment:
Thanks
ReplyDeleteit Was very useful.........
awesome
ReplyDeleteCheck Selenium Tutorial free
Deleteabove links are not working
ReplyDeleteCheck Free Selenium Tutorial
DeleteThanks for the great information in your blog Selenium Training
ReplyDeleteThe blog that you shared regarding the FitNesse become very easy to download. But, tell me that the primary difference in using JBehave other than FitNesse in component testing.
ReplyDeleteSelenium Training in Chennai
Once you write this Java class, write an Ant script to compile the code and package it into a Java Archive Resource (JAR) file. Most Selenium users will run their Selenium tests from the Ant script itself.
ReplyDeleteRead more: Selenium Training in Chennai
Selenium Training in Velachery
Selenium Training Institute in Chennai
Good work! I have to read search for some blog related to Selenium Automation Tools Fitness across that I See this blog link, In these blog site information, helped to us, we share it marvelous Quality of content Great Job Doing Well Done.
ReplyDeleteSelenium Training in Chennai
Thank You
ReplyDeleteLegal advisor in Chennai
This comment has been removed by the author.
ReplyDeleteThanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital information... Java Training in Chennai | Blue prism Training in Chennai
ReplyDeleteThose rules moreover attempted to wind up plainly a decent approach to perceive that other individuals online have the indistinguishable enthusiasm like mine to get a handle on incredible arrangement more around this condition
ReplyDeletesafety course in chennai
Useful blog, keep sharing more like this.
ReplyDeleteBlue Prism Training Chennai
RPA Training in Chennai
UiPath Training in Chennai
Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us. Do check | Get trained by an expert who will enrich you with the latest updates.
ReplyDeleteWeb Designing Course in chennai
Java Training in Chennai
Web Designing Course in Chennai with placement
website design courses
Java Classes in Chennai
Core Java Training in Chennai
In the beginning, I would like to thank you much about this great post. Its very useful and helpful for anyone looking for tips to help him learn and master in Angularjs. I like your writing style and I hope you will keep doing this good working.
ReplyDeleteAngularjs Training in Bangalore
Angularjs Training Institute In Bangalore
Angularjs Course in Bangalore
Android Institute in Bangalore
Android Coaching in Bangalore
Android Coaching Center in Bangalore
Nice post. I learned some new information. Thanks for sharing.
ReplyDeletechocolatesanddreams
Guest posting sites
I have to thank for sharing this blog, really helpful to me.
ReplyDeleteAngularjs Training in Chennai
Angular 6 Training in Chennai
RPA Training in Chennai
AWS Training in Chennai
DevOps Certification Chennai
Amazing information,thank you for your ideas.after along time i have studied an interesting information's.we need more updates in your blog.
ReplyDeleteangularjs tutorial in bangalore
angularjs institutes in bangalore
Angular JS Training in chennai
AngularJS Training Institutes in Vadapalani
Thanks Admin for sharing such a useful post, I hope it’s useful to many individuals for developing their skill to get good career.
ReplyDeleteSelenium training in Chennai | Selenium training institute in Chennai | Selenium course in Chennai
Selenium training in Bangalore | Selenium training institute in Bangalore | Selenium course in Bangalore
Selenium interview questions and answers
Selenium training in Pune | Selenium training institute in Pune | Selenium course in Pune
This is a terrific article, and that I would really like additional info if you have got any. I’m fascinated with this subject and your post has been one among the simplest I actually have read.
ReplyDeleteData Science Course in Indira nagar
Data Science Course in btm layout
Python course in Kalyan nagar
Data Science course in Indira nagar
Data Science Course in Marathahalli
Data Science Course in BTM Layout
Informative and interesting! Thanks for sharing.
ReplyDeleteTally Course in Chennai
Tally Classes in Chennai
Tally Training in Chennai
Spark Training Academy Chennai
VMware Training Center in Chennai
WordPress Training Institute in Chennai
Hello! This is my first visit to your blog! We are a team of volunteers and starting a new initiative in a community in the same niche. Your blog provided us useful information to work on. You have done an outstanding job.
ReplyDeleteAdvanced AWS Training in Chennai | Best Amazon Web Services Training in Chennai
AWS Training in Bangalore Reviews | AWS Training in Bangalore Cost
AWS Online Training India | AWS Online Training Fees
Wonderful Post. The content is very much thought provoking. Thanks for sharing.
ReplyDeleteEthical Hacking Course in Chennai
Hacking Course in Chennai
Ethical Hacking Training in Chennai
Certified Ethical Hacking Course in Chennai
IELTS coaching in Chennai
IELTS Training in Chennai
Spoken English Classes in Chennai
Best Spoken English Classes in Chennai
Some us know all relating to the compelling medium you present powerful steps on this blog and therefore strongly encourage
ReplyDeletecontribution from other ones on this subject while our own child is truly discovering a great deal.
Have fun with the remaining portion of the year.
Selenium training in bangalore | best selenium training in bangalore
Incredible writing. Fantabulous Post. Thanks for sharing.
ReplyDeleteXamarin Training in Chennai
Xamarin Course in Chennai
Xamarin Training Institutes in Chennai
Xamarin Training
Xamarin Course
Xamarin Training Course
Xamarin Training in Anna Nagar
Xamarin Training in Tnagar
After reading your blog I was amazed. The blog was explained clearly. And I hope all other readers will understand and experience how I felt after reading such a wonderful blog.
ReplyDeleteIELTS Coaching in chennai
German Classes in Chennai
GRE Coaching Classes in Chennai
TOEFL Coaching in Chennai
spoken english classes in chennai | Communication training
The blog gives more information about the training and career, its useful to enhance my skills and knowledge.thanks lot!!
ReplyDeleteJava training in Chennai
Java Online training in Chennai
Java Course in Chennai
Best JAVA Training Institutes in Chennai
Java training in Bangalore
Java training in Hyderabad
Java Training in Coimbatore
Java Training
Java Online Training
Thank you for the information. It is very useful and informative
ReplyDeleteangular js training in chennai
angular training in chennai
angular js online training in chennai
angular js training in bangalore
angular js training in hyderabad
angular js training in coimbatore
angular js training
angular js online training
Thanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital information.
ReplyDeleteAWS Course in Chennai
AWS Course in Bangalore
AWS Course in Hyderabad
AWS Course in Coimbatore
AWS Course
AWS Certification Course
AWS Certification Training
AWS Online Training
AWS Training
This is a terrific article, and that I would really like additional info if you have got any. I’m fascinated with this subject and your post has been one among the simplest I actually have read.
ReplyDeleteacte reviews
acte velachery reviews
acte tambaram reviews
acte anna nagar reviews
acte porur reviews
acte omr reviews
acte chennai reviews
acte student reviews
Awesome! Education is the extreme motivation that open the new doors of data and material. So we always need to study around the things and the new part of educations with that we are not mindful.
ReplyDeletepython training in bangalore
python training in hyderabad
python online training
python training
python flask training
python flask online training
python training in coimbatore
Yes, it is hard, compared to other small desktop or web programming projects. ... If you have prior experience in programming than android dev will be very easy to pick up, especially if you're familiar in Java.thanks lot!!
ReplyDeleteAndroid Training in Chennai
Android Online Training in Chennai
Android Training in Bangalore
Android Training in Hyderabad
Android Training in Coimbatore
Android Training
Android Online Training
Superb blog post! And this blog clearly explain about for useful information. I would Thanks for sharing this wonderful content.its very useful to us. Keep it up!
ReplyDeleteSoftware Testing Training in Chennai
Software Testing Online Training in Chennai
Software Testing Courses in Chennai
Software Testing Training in Bangalore
Software Testing Training in Hyderabad
Software Testing Training in Coimbatore
Software Testing Training
Software Testing Online Training
Great analysis, very useful
ReplyDelete| Certification | Cyber Security Online Training Course | Ethical Hacking Training Course in Chennai | Certification | Ethical Hacking Online Training Course | CCNA Training Course in Chennai | Certification | CCNA Online Training Course | RPA Robotic Process Automation Training Course in Chennai | Certification | RPA Training Course Chennai | SEO Training in Chennai | Certification | SEO Online Training Course
I have bookmarked your blog, the articles are characteristic expanded than substitute related websites.. gratitude for a warm blog! Quick Heal Crack
ReplyDeleteVery secure message. I just staggered concerning your blog and wanted to broadcast that i've as a general rule cherished concentrating on your blog entries. Any pomposity i'll buy in on your feed and I slant you announce again rapidly. colossal gratitude for the helpful information. Kaspersky Antivirus Crack
ReplyDeleteThanks for sharing this informative blog.
ReplyDeleteBudget family rooms in Ooty