Python_ test your web applications using Splinter

Splinter是一款开源工具,用于使用Python进行Web应用测试。它能够自动执行浏览器操作,如访问网址及与页面元素交互等。支持多种浏览器驱动(Chrome、Firefox等),提供简单的API,并兼容CSS和XPath选择器。
摘要由CSDN通过智能技术生成

Splinter is an open source tool for testing web applications using Python. It lets you automate browser actions, such as visiting URLs and interacting with their items.

sample code

 
 
from splinter.browser import Browser
 browser
= Browser()
 
# Visit URL
 url
= "http://www.google.com"
 browser
.visit(url)
 browser
.fill('q', 'splinter - python acceptance testing for web applications')
 
# Find and click the 'search' button
 button
= browser.find_by_name('btnK')
 
# Interact with elements
 button
.click()
 
if browser.is_text_present('splinter.cobrateam.info'):
     
print "Yes, the official website was found!"
 
else:
     
print "No, it wasn't found... We need to improve our SEO techniques"
               

features

  • simple api
  • multi webdrivers (chrome, firefox, zopetestbrowser)
  • css and xpath selectors
  • support to iframe and alert
  • execute javascript
  • work's with ajax and async javascript

getting started

when you're ready to test, read the installation guide and tutorial.


Splinter is an open source tool for testing web applications using Python. It lets you automate browser actions, such as visiting URLs and interacting with their items.

sample code

 
 
from splinter.browser import Browser
 browser
= Browser()
 
# Visit URL
 url
= "http://www.google.com"
 browser
.visit(url)
 browser
.fill('q', 'splinter - python acceptance testing for web applications')
 
# Find and click the 'search' button
 button
= browser.find_by_name('btnK')
 
# Interact with elements
 button
.click()
 
if browser.is_text_present('splinter.cobrateam.info'):
     
print "Yes, the official website was found!"
 
else:
     
print "No, it wasn't found... We need to improve our SEO techniques"
               

features

  • simple api
  • multi webdrivers (chrome, firefox, zopetestbrowser)
  • css and xpath selectors
  • support to iframe and alert
  • execute javascript
  • work's with ajax and async javascript

getting started

when you're ready to test, read the installation guide and tutorial.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值