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.

41 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!

Unknown 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

Unknown said...

Valuable information thanks for sharing Selenium Online Training

Unknown said...

good information thanks for sharing it
Selenium Training in Chennai

Unknown 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

saranya 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

Unknown 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.

raju said...

very nice blogger.......................!!!
inplant training in chennai
inplant training in chennai
inplant training in chennai for it
panama web hosting
syria hosting
services hosting
afghanistan shared web hosting
andorra web hosting
belarus web hosting
brunei darussalam hosting

dras said...

very informative post..!
inplant training in chennai
inplant training in chennai
inplant training in chennai for it
Australia hosting
mexico web hosting
moldova web hosting
albania web hosting
andorra hosting
australia web hosting
denmark web hosting

ammu said...

excellent information....!
inplant training in chennai
inplant training in chennai
inplant training in chennai for it
brunei darussalam web hosting
costa rica web hosting
costa rica web hosting
hong kong web hosting
jordan web hosting
turkey web hosting
gibraltar web hosting

preethi minion said...

very nice.....!
inplant training in chennai
inplant training in chennai
inplant training in chennai for it
italy web hosting
afghanistan hosting
angola hosting
afghanistan web hosting
bahrain web hosting
belize web hosting
india shared web hosting

shree said...

superb....
inplant training in chennai for it
namibia web hosting
norway web hosting
rwanda web hosting
spain hosting
turkey web hosting
venezuela hosting
vietnam shared web hosting



kani said...

nice..
inplant training in chennai
inplant training in chennai
inplant training in chennai for it
hosting
india hosting
india web hosting
iran web hosting
technology 11 great image sites like imgur hosting
final year project dotnet server hacking what is web hosting
macao web hosting

rajan said...

inplant training in chennai
inplant training in chennai
inplant training in chennai for it.php
chile web hosting
colombia web hosting
croatia web hosting
cyprus web hosting
bahrain web hosting
india web hosting
iran web hosting

shiv said...

nice...................
inplant training in chennai
inplant training in chennai
inplant training in chennai for it
algeeria hosting
angola hostig
shared hosting
bangladesh hosting
botswana hosting
central african republi hosting
shared hosting

hari said...

good
inplant training in chennai
inplant training in chennai
online python internship
online web design
online machine learning internship
online internet of things internship
online cloud computing internship
online Robotics
online penetration testing

shri said...

super...!
internship in chennai for ece students
internships in chennai for cse students 2019
Inplant training in chennai
internship for eee students
free internship in chennai
eee internship in chennai
internship for ece students in chennai
inplant training in bangalore for cse
inplant training in bangalore
ccna training in chennai


Muthu said...

Very Nice...
internship in chennai for ece students with stipend
internship for mechanical engineering students in chennai
inplant training in chennai
free internship in pune for computer engineering students
internship in chennai for mca
iot internships
internships for cse students in
implant training in chennai
internship for aeronautical engineering students in bangalore
inplant training certificate


sugan said...

very nice post blog.........
r programming training in chennai
internship in bangalore for ece students
inplant training for mechanical engineering students
summer internships in hyderabad for cse students 2019
final year project ideas for information technology
bba internship certificate
internship in bangalore for ece
internship for cse students in hyderabad
summer training for ece students after second year
robotics courses in chennai


sibiselvan said...

it is excellent blogs...!!
inplant training for diploma students
mechanical internship in chennai
civil engineering internship in chennai
internship for b.arch students in chennai
internship for ece students in core companies in chennai
internship in chandigarh for ece
industrial training report for computer science engineering on python
internship for automobile engineering students in chennai
big data training in chennai
ethical hacking internship in chennai

KUTTYMA said...

nice information....

winter internship for engineering students
internship for mca students
inplant training for eee students
inplant training for eee students/
java training in chennai
internships for eee students in hyderabad
ece internship
internship certificate for mechanical engineering students
internship in nagpur for computer engineering students
kaashiv infotech internship
internship for aeronautical engineering students in india 2019

anuarun said...

nice information......
ree internship in bangalore for computer science students
internship for aeronautical engineering
internship for eee students in hyderabad
internship in pune for computer engineering students 2018
kaashiv infotech internship fees
industrial training certificate format for mechanical engineering students
internship report on machine learning with python
internship for biomedical engineering students in chennai
internships in bangalore for cse
internship in coimbatore for ece

raju said...

very nice blogger thanks for sharing......!!!
poland web hosting
russian federation web hosting
slovakia web hosting
spain web hosting
suriname
syria web hosting
united kingdom
united kingdom shared web hosting
zambia web hosting