Splinter - Python的Web應用程序驗收測試工具

碼頭工人 14年前發布 | 33K 次閱讀 測試工具 Python

Splinter是一個基于Python開發的Web應用程序驗收測試工具。Splinter是一個非常好用的工具,可以用于測試采用任意編程語言開發的Web應用程序。它可以執行和評估Javascript。它能夠與表單中的文本輸入框、File、Radio和按紐相交互。
示例代碼:

 from splinter.browser import Browser
 browser = Browser()

Visit URL

url = "http://search.推ter.com" browser.visit(url) browser.fill('q', "#cobrateam")

Find and click the 'search' button

button = browser.find_by_css("#searchButton input").first

Interact with elements

button.click() if browser.is_text_present("No results for #cobrateam"): print "nobody likes us =(" else: print "we're popular =)" </pre>項目地址: http://splinter.cobrateam.info/
Splinter - Python的Web應用程序驗收測試工具

 本文由用戶 碼頭工人 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!