SlideShare a Scribd company logo
UI Testing with Splinter
Taizo Ito <taizo.ito@hde.co.jp>
HDE, Inc.
What’s Splinter?
UI Testing tool for web applications
- Open source software (BSD-like License)
- Implemented by Python
As of this writing, there seems to be no other python-implemented tools like this.
- It helps you control actions on web browser
Features
- Easy to install/setup
- Support popular browsers
- Easy to use
Simple and intuitive API
Installation
Simply run the following command. That’s all!
$ sudo pip install splinter
As an additional requirement, a web client such as
Chrome, Firefox and PhantomJS must be installed.
Supported Browsers
Splinter provides multiple web drivers:
Browser based
Chrome, Firefox, (Remote)
Headless
PhantomJS, zope.testbrowser, django client, Flask client
Remote
Uses Selenium RC to automate browser actions on a remote machine such as
Sauce Labs.
Web
Driver
Splinter is an abstraction layer
The same test code covers actions of any browser
A
P
I
Browser-based
Selenium
Headless
PhantomJS
zope.testbrowser
Chrome
Firefox
RemoteTest
Code
Remote
Webdriver Server
Sauce Labs (IE)
HTTP
Splinter
APIs
Each method is so intuitive; It’s easy to use.
- visit()
Go to the specified URL. e.g. browser.visit(‘http://www.hde.co.jp’) # then you can see html text from
browser.html.
- fill()
Fill an input form with the specified text. e.g. browser.find_by_id(‘your_name’).fill(‘taizo’)
- click()
Click an element such as button or link text. e.g. browser.find_by_id(‘search_button’).click()
and more…
Example: Login with Single Sign On(1)
Login to App using Google Apps Federated Login
1 browser = Browser(“phantomjs”)
2
3 browser.visit(“https://foobar.example.com/login”)
4
5 browser.find_by_id(“Email”).fill(“foobar@example.com”)
6 browser.find_by_id(“Passwd”).fill(“secret_password”)
7 browser.find_by_id(“signIn”).click()
8 time.sleep(1)
9
10 if browser.title == “Request for Permission”:
11 browser.find_by_id(“submit_approve_access”).click()
12 time.sleep(1)
13
14 assert browser.title == “This is a title of App”, “Failed to login”
Example: Login with Single Sign On(2)
Login to App using Microsoft WAAD SAML
1 browser = Browser(“phantomjs”)
2
3 browser.visit(“https://foobar.example.com/login”)
4
5 browser.find_by_id(“cred_userid_inputtext”).fill(“foobar@example.com”)
6 browser.find_by_id(“cred_password_inputtext”).fill(“secret_password”)
7 browser.find_by_id(“cred_keep_me_signed_in_checkbox”).check()
8 time.sleep(1)
9 browser.find_by_id(“cred_sign_in_button”).click()
10 time.sleep(1)
11
12 assert browser.title == “This is a title of App”, “Failed to login”
Other features
Cookie Manager
● browser.cookies.all()
● browser.cookies.add()
● browser.cookies.delete()
Features not implemented
We are not allowed to:
- Get contents of downloaded data by using Splinter.
We have to use requests module to get it instead of Splinter.
- Customize HTTP Request headers when using headless web driver.
Therefore, we can’t check if the multi-language feature of web apps works well.
Accept-Language: en-US,en;q=0.8,ja;q=0.6
Tips
- Use Google Chrome’s Developer Console to get the
XPath of an element.
It is easy to identify the element using find_by_xpath().
- To customize HTTP Request headers in PhantomJS
driver,
get the latest vesion from Github, which supports custom headers.
My PR was accepted ;-) https://github.com/cobrateam/splinter/pull/316
- Use Splinter with behave. http://pythonhosted.org/behave/
You can easily practice BDD(Behavior-Driven Development) for web apps with Python.
Thank you
Taizo Ito <taizo.ito@hde.co.jp>
HDE, Inc.

More Related Content

DOCX
โปรแกรม Flash
KEY
Like a Genie from a Lamp: Headless JavaScript Unit Testing with Jasmine and P...
PPTX
Using disqus & facebook comment in wordpress themes
PPT
Developing Joomla Extensions JUG Bangladesh meetup dhaka-2012
TXT
Usb hack
PDF
Exbrowser command-reference
PPTX
Learn Test Automation using Selenium - Lesson 1
PPTX
Web browsers
โปรแกรม Flash
Like a Genie from a Lamp: Headless JavaScript Unit Testing with Jasmine and P...
Using disqus & facebook comment in wordpress themes
Developing Joomla Extensions JUG Bangladesh meetup dhaka-2012
Usb hack
Exbrowser command-reference
Learn Test Automation using Selenium - Lesson 1
Web browsers

What's hot (8)

PPT
PHP: Debugger, Profiler and more
POT
Browser extension
PPT
A Complete Guide To Chrome Extension Development
PDF
Firefox Extension Development
PPTX
Selenium Open Source Tool
PPT
Selenium Ide Tutorials
PDF
Banquet 42
PDF
What The Flask? and how to use it with some Google APIs
PHP: Debugger, Profiler and more
Browser extension
A Complete Guide To Chrome Extension Development
Firefox Extension Development
Selenium Open Source Tool
Selenium Ide Tutorials
Banquet 42
What The Flask? and how to use it with some Google APIs
Ad

Viewers also liked (20)

PPTX
How to study english
PPTX
Jun.27 fukutomi
PDF
Studying Abroad in Cebu
PDF
DockerCon 14
PDF
First impressions of Go
PPTX
Implementation of gui framework part1
PPTX
Implementation of gui framework part2
PPTX
A brief introduction to CentOS 7
PDF
Overview pcidss
PPTX
Implementation of GUI Framework part3
PDF
Hello pivotal tracker
PDF
Introducing chrome apps (ogura)
PDF
Do not rm_log_files
PPTX
Introduction to bioinformatics
PPTX
Implement server push in flask framework
PDF
Introduction to systemd
PPTX
Garbled text in email
PDF
AWS Cost Visualizer
PPTX
The language barrier.
PDF
Authentication
How to study english
Jun.27 fukutomi
Studying Abroad in Cebu
DockerCon 14
First impressions of Go
Implementation of gui framework part1
Implementation of gui framework part2
A brief introduction to CentOS 7
Overview pcidss
Implementation of GUI Framework part3
Hello pivotal tracker
Introducing chrome apps (ogura)
Do not rm_log_files
Introduction to bioinformatics
Implement server push in flask framework
Introduction to systemd
Garbled text in email
AWS Cost Visualizer
The language barrier.
Authentication
Ad

Similar to Ui testing with splinter - Fri, 30 May 2014 (20)

PDF
Detecting headless browsers
PPTX
Setting UIAutomation free with Appium
PPT
Introduction to python scrapping
PPTX
Web testing with Selenium
PDF
Browser-level testing
PPTX
QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени...
PPTX
Setting Apple's UI Automation Free with Appium
PDF
Firefox OS Introduction at Bontouch
PDF
Mozilla, Firefox OS and the Open Web
PPT
Play framework
PPT
By combining Selenium for frontend testing and tools
PDF
PHP SA 2014 - Releasing Your Open Source Project
PDF
Dev Dives: Boosting Productivity with Coded Automation and Autopilot™
KEY
LvivPy - Flask in details
PPT
PPTX
OWASP Zed Attack Proxy
PPTX
Whys and Hows of Automation
PDF
JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...
PPTX
Take control. write a plugin. part II
PDF
Intro to Selenium UI Tests with pytest & some useful pytest plugins
Detecting headless browsers
Setting UIAutomation free with Appium
Introduction to python scrapping
Web testing with Selenium
Browser-level testing
QA Fest 2014. Ярослав Пернеровский. Appium - два в одном. рецепт приготовлени...
Setting Apple's UI Automation Free with Appium
Firefox OS Introduction at Bontouch
Mozilla, Firefox OS and the Open Web
Play framework
By combining Selenium for frontend testing and tools
PHP SA 2014 - Releasing Your Open Source Project
Dev Dives: Boosting Productivity with Coded Automation and Autopilot™
LvivPy - Flask in details
OWASP Zed Attack Proxy
Whys and Hows of Automation
JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...
Take control. write a plugin. part II
Intro to Selenium UI Tests with pytest & some useful pytest plugins

Recently uploaded (20)

PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Nekopoi APK 2025 free lastest update
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
ai tools demonstartion for schools and inter college
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
history of c programming in notes for students .pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
AI in Product Development-omnex systems
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Transform Your Business with a Software ERP System
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Odoo POS Development Services by CandidRoot Solutions
Internet Downloader Manager (IDM) Crack 6.42 Build 41
wealthsignaloriginal-com-DS-text-... (1).pdf
VVF-Customer-Presentation2025-Ver1.9.pptx
Nekopoi APK 2025 free lastest update
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Understanding Forklifts - TECH EHS Solution
ai tools demonstartion for schools and inter college
Design an Analysis of Algorithms I-SECS-1021-03
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
history of c programming in notes for students .pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
How to Choose the Right IT Partner for Your Business in Malaysia
AI in Product Development-omnex systems
PTS Company Brochure 2025 (1).pdf.......
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Transform Your Business with a Software ERP System
CHAPTER 2 - PM Management and IT Context
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Odoo POS Development Services by CandidRoot Solutions

Ui testing with splinter - Fri, 30 May 2014

  • 1. UI Testing with Splinter Taizo Ito <taizo.ito@hde.co.jp> HDE, Inc.
  • 2. What’s Splinter? UI Testing tool for web applications - Open source software (BSD-like License) - Implemented by Python As of this writing, there seems to be no other python-implemented tools like this. - It helps you control actions on web browser
  • 3. Features - Easy to install/setup - Support popular browsers - Easy to use Simple and intuitive API
  • 4. Installation Simply run the following command. That’s all! $ sudo pip install splinter As an additional requirement, a web client such as Chrome, Firefox and PhantomJS must be installed.
  • 5. Supported Browsers Splinter provides multiple web drivers: Browser based Chrome, Firefox, (Remote) Headless PhantomJS, zope.testbrowser, django client, Flask client Remote Uses Selenium RC to automate browser actions on a remote machine such as Sauce Labs.
  • 6. Web Driver Splinter is an abstraction layer The same test code covers actions of any browser A P I Browser-based Selenium Headless PhantomJS zope.testbrowser Chrome Firefox RemoteTest Code Remote Webdriver Server Sauce Labs (IE) HTTP Splinter
  • 7. APIs Each method is so intuitive; It’s easy to use. - visit() Go to the specified URL. e.g. browser.visit(‘http://www.hde.co.jp’) # then you can see html text from browser.html. - fill() Fill an input form with the specified text. e.g. browser.find_by_id(‘your_name’).fill(‘taizo’) - click() Click an element such as button or link text. e.g. browser.find_by_id(‘search_button’).click() and more…
  • 8. Example: Login with Single Sign On(1) Login to App using Google Apps Federated Login 1 browser = Browser(“phantomjs”) 2 3 browser.visit(“https://foobar.example.com/login”) 4 5 browser.find_by_id(“Email”).fill(“foobar@example.com”) 6 browser.find_by_id(“Passwd”).fill(“secret_password”) 7 browser.find_by_id(“signIn”).click() 8 time.sleep(1) 9 10 if browser.title == “Request for Permission”: 11 browser.find_by_id(“submit_approve_access”).click() 12 time.sleep(1) 13 14 assert browser.title == “This is a title of App”, “Failed to login”
  • 9. Example: Login with Single Sign On(2) Login to App using Microsoft WAAD SAML 1 browser = Browser(“phantomjs”) 2 3 browser.visit(“https://foobar.example.com/login”) 4 5 browser.find_by_id(“cred_userid_inputtext”).fill(“foobar@example.com”) 6 browser.find_by_id(“cred_password_inputtext”).fill(“secret_password”) 7 browser.find_by_id(“cred_keep_me_signed_in_checkbox”).check() 8 time.sleep(1) 9 browser.find_by_id(“cred_sign_in_button”).click() 10 time.sleep(1) 11 12 assert browser.title == “This is a title of App”, “Failed to login”
  • 10. Other features Cookie Manager ● browser.cookies.all() ● browser.cookies.add() ● browser.cookies.delete()
  • 11. Features not implemented We are not allowed to: - Get contents of downloaded data by using Splinter. We have to use requests module to get it instead of Splinter. - Customize HTTP Request headers when using headless web driver. Therefore, we can’t check if the multi-language feature of web apps works well. Accept-Language: en-US,en;q=0.8,ja;q=0.6
  • 12. Tips - Use Google Chrome’s Developer Console to get the XPath of an element. It is easy to identify the element using find_by_xpath(). - To customize HTTP Request headers in PhantomJS driver, get the latest vesion from Github, which supports custom headers. My PR was accepted ;-) https://github.com/cobrateam/splinter/pull/316 - Use Splinter with behave. http://pythonhosted.org/behave/ You can easily practice BDD(Behavior-Driven Development) for web apps with Python.
  • 13. Thank you Taizo Ito <taizo.ito@hde.co.jp> HDE, Inc.