Splinter - A Wrapper Library for Selenium with Python - Codoid
Select Page
Codoid Blog

Splinter – A Wrapper Library for Selenium with Python

Irrespective of the business that your client is in, marketing is an integral part of their operations. In fact, in this day and age of social.

Splinter is a python library and it has common readable wrapper methods for Selenium and zope.testbrowser frameworks. If you would like to write readable automated tests using Python, then Splinter is a good choice. As an automation testing company, exploring new tools/libraries is one of the important R&D activities. Please subscribe our blog to get the updates. Now, let’s see how to use Splinter.

How to install Splinter?

pip install splinter
[/code]

Browser LaunchWhat we have noticed with Splinter during Browser launch is the browser is launched very quickly. If you are also noticing the same, please feel free to comment over here.

from splinter import Browser

browser = Browser('chrome')
[/code]

URL Navigation

browser.visit('https://codoid.com')
[/code]

Find ElementYou can use the following methods find_by_css, find_by_xpath, find_by_name, find_by_tag, find_by_value, find_by_text, and find_by_id to locate an element.

browser.find_by_id('menu-item-54').click()
[/code]

All together

from splinter import Browser

browser = Browser('chrome')

browser.visit('https://codoid.com')

browser.find_by_id('menu-item-54').click()

browser.quit()
[/code]

Written By

Submit a Comment

Your email address will not be published. Required fields are marked *


Splinter is a python library and it has common readable wrapper methods for Selenium and zope.testbrowser frameworks. If you would like to write readable automated tests using Python, then Splinter is a good choice. As an automation testing company, exploring new tools/libraries is one of the important R&D activities. Please subscribe our blog to get the updates. Now, let’s see how to use Splinter.

How to install Splinter?

pip install splinter
[/code]

Browser LaunchWhat we have noticed with Splinter during Browser launch is the browser is launched very quickly. If you are also noticing the same, please feel free to comment over here.

from splinter import Browser

browser = Browser('chrome')
[/code]

URL Navigation

browser.visit('https://codoid.com')
[/code]

Find ElementYou can use the following methods find_by_css, find_by_xpath, find_by_name, find_by_tag, find_by_value, find_by_text, and find_by_id to locate an element.

browser.find_by_id('menu-item-54').click()
[/code]

All together

from splinter import Browser

browser = Browser('chrome')

browser.visit('https://codoid.com')

browser.find_by_id('menu-item-54').click()

browser.quit()
[/code]