Listen to this blog |
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 Browserbrowser = 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 Browserbrowser = Browser('chrome')
browser.visit('https://codoid.com')
browser.find_by_id('menu-item-54').click()
browser.quit()
[/code]
Posted on 30/07/2019