Saturday, December 22, 2012

Clojure, Selenium-WebDriver, and PhantomJS

The following is a small manual of how to setup PhantomJS and use it from Clojure via clj-webdriver  - Clojure API for Selenium-WebDriver.


1. Start a new project using Leiningen:

2. Download PhantomJS from http://phantomjs.org/download.html and unpack it into your project's directory:

3. Now add the following to your project.clj file:


By the way, there is an awesome Leiningen plugin that checks if your dependencies are up to date.

4. Tell Leiningen to update dependencies:

5. Now let's start a REPL to check if everything's in its right place:

Hope it works! If not, ping me and I'll update the tutorial.

25 comments:

Paul Crowley said...

Yes, this works for me - and I had some trouble working out how to plug ghostdriver into Clojure tests until I found this, so many thanks! Sadly our tests, which pass with chromedriver, don't pass with ghostdriver, so some investigation remains to be done, but nonetheless many thanks!

Hans-J. Schmid said...

This is frigging awesome!!! Thanks for the info!!!

bluegray said...

This works great! Is it possible to take a full screen screenshot?

Anonymous said...

for windows curl the windows binary
and replace in the project.clj

:jvm-opts ["-Dphantomjs.binary.path=./phantomjs-1.9.8-windows/phantomjs.exe"]

TheMesaMilieu said...

Great stuff, thanks for this post!

RS Trainings said...

This is a great article man, thanks for the tips! It’s refreshing to learn so many new ways to kick off blog posts.

best online MSBI training
online abinitio training in usa,uk,india,canada
selenium training
best R programming online training
SAP HANA online training in india

Praveen Kumar said...

Valuable information thanks for sharing Selenium Online Training

santhosh kumar said...

good information thanks for sharing it
Selenium Training in Chennai

Logavani G said...

really you have post an informative blog. really it will be helpful to the peoples who are all working in this technology. thank you for sharing this blog.
selenium training in chennai

mellbahenry said...

I am following your blog from the beginning, i gathered lot of information from your post. and also i would like to suggest your blog to my friends. Thank you. Software Testing Training in Chennai
Software Testing Training in Chennai

sriram said...

I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly.

software testing training in chennai

Inigo joseph said...

I simply wanted to write down a quick word to say thanks to you for those wonderful tips and hints you are showing on this site. Best Java Training Institute Chennai

aravinth periyaswami said...

I am happy to find this post Very useful for me, as it contains lot of information. I Always prefer to read The Quality and glad I found this thing in you post.

selenium training in chennai

Unknown said...

Perfect !

akhilapriya404 said...

This concept is a good way to enhance the knowledge.thanks for sharing. please keep it up selenium Online Training Hyderabad

Anoushka Sakthi said...

I don't have the time at the moment to fully read your site but I have bookmarked it and also add your feeds.

Selenium Training in Chennai
selenium testing training in chennai
iOS Training in Chennai
French Classes in Chennai
Big Data Training in Chennai
web designing course
web designing courses
web design training chennai

dinesh said...

Excellent Blog!!! Such an interesting blog with clear vision, this will definitely help for beginner to make them update.
German Classes in Chennai
German Language Classes in Chennai
Digital Marketing Training in Chennai
JAVA Training in Chennai
JAVA Course in Chennai

sathyaramesh said...

Thanks for sharing such a nice info.I hope you will share more information like this. please keep on sharing!
Angularjs Training in Chennai
Angularjs course in Chennai
Web Designing Course in chennai
PHP Training in Chennai
Hadoop Training in Chennai
AngularJS Training in OMR
AngularJS Training in Tambaram

Durai Raj said...

Awesome Blog!!! Good to Read... Thanks for sharing with us.
Embedded course in Coimbatore
embedded training in coimbatore
embedded systems course in coimbatore
RPA training in bangalore
Selenium Training in Bangalore
Java Training in Madurai
Oracle Training in Coimbatore
PHP Training in Coimbatore

Maria said...

Yesterday I came to visit my sister and we decided to have fun and play online casinos, polazili on a bunch of sites and this one caught my eye unforgettable online cash casino Here we quickly figured out what was happening and began to think quickly about the strategy. and we found her now we take money out of here every day

divyapriya said...

Thanks for posting this. Its really informative.
German Classes in Chennai
German Courses in Chennai
IELTS Coaching in Chennai
Japanese Classes in Chennai
spanish language in chennai
Spoken English Classes in Chennai
German classes in Anna Nagar
German classes in Velachery

Aditi Ray said...

Home Mart is a site about Home Improvement, Furniture, Home Appliances and many more.
Check out the best
entertainment unit
shoe rack
balance bike

sathyaramesh said...

Its a wonderful post and very helpful, thanks for all this information. You are including better information regarding this topic in an effective way. T hank you so much.
Spoken English Class in Coimbatore
Best Spoken English Classes in Coimbatore
Spoken English in Coimbatore
IELTS Coaching in Coimbatore
IELTS Coaching Center in Coimbatore
German Classes in Coimbatore
German Courses in Coimbatore

Google Ads Services said...

Thanks for sharing an informative blog keep rocking bring more details.I like the helpful info you provide in your articles. I’ll bookmark your weblog and check again here regularly. I am quite sure I will learn much new stuff right here! Good luck for the next!
Web Designing Training Institute in Chennai | web design training class in chennai | web designing course in chennai with placement
Mobile Application Development Courses in chennai
Data Science Training in Chennai | Data Science courses in Chennai
Professional packers and movers in chennai | PDY Packers | Household Goods Shifting
Web Designing Training Institute in Chennai | Web Designing courses in Chennai
Google ads services | Google Ads Management agency
Web Designing Course in Chennai | Web Designing Training in Chennai

Chris Hemsworth said...


The article is so informative. This is more helpful for our
magento training course in chennai
magento training institute in chennai
magento 2 training in chennai
magento development training
magento 2 course
magento developer training
Thanks for sharing.