python testing framework

Alibabacloud.com offers a wide variety of articles about python testing framework, easily find your python testing framework information here online.

Functional Testing-python, Selenium and Django

Functional Testing-python Selenium Django-source Code:From selenium import WebdriverFrom selenium.webdriver.common.by Import byFrom django.test import liveservertestcaseClass Browser (): # (Run more than one testcases on one Browser)Browser = Nonedef __new__ (CLS):Browser.browser = Browser.browser or Webdriver. Firefox ()Return Browser.browserClass Base (Liveservertestcase):def setUp (self):Self.browser = b

A complete automated login test-Cnblog Automated login testing based on Python+selenium

Web login testing is a very common test! Manual test Everyone is familiar with, how to do automated login test it! The author of this paper uses Python+selenium Automation to do a simple but relatively complete cnblog login test, to provide you with a point of reference! The following includes the test code and each of the test cases:The login test of the Cnblog is divided into the following situations: (1)

Senior programmers use Python for data-driven interface automation testing!

2. The programmeFor the above API, when doing interface testing, the test cases need to be up to 10 +, this time in a data-driven way to write the common content of the configuration file may be more appropriate.Here consider the API, parameters, and expected results preprint in the formatted CSV, using the CSV component to read the URL, parameters, and expected results from the CSV, requests component initiates the request, compare the response resul

Python Selenium Automated Testing

Reproduced in this article Grey, blue, blue, blue and blue.Links: http://www.jianshu.com/p/5188cb3ab790Source: PinterestCopyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.More technical blogs See http://blog.csdn.net/huilan_same The first part: Selenium study site, read the content of these sites, I believe your selenium can reach a certain level.The second part: Selenium resources, v

SELENIUM2 python automated testing using the AutoIt tool for local file uploads

SELENIUM2 python automated testing using the AutoIt tool for local file uploadsI'm learning based onPythonlanguage ofselenium2During the automated test method, when a test involving a local upload file is found,selenium2when locating localwindowThere is limited capacity on the object (element) of the window. When the upload button is using theinputlabel, you can use theSend_keys ()method to add a local file

Introduction and use of Python automated testing tool Splinter

This article describes the introduction and use of the Python automated testing tool Splinter. Splinter can simulate browser behavior very well. Splinter provides a wide range of APIs, get the page information to determine the results of the current behavior Splinter quick introduction Http://splinter.cobrateam.info/ Official introduction: Splinter is an open source tool for testingweb applications using

Selenium+python Automated Testing

(script, *args): Executes the JS script asynchronously browser.get(url): Loads the URL in the current window browser.refresh(): Refreshes the current page browser.current_window_handle: The handle of the current window, which is the same as a pointer, to point to the current window browser.window_handles: All windows that are already open in the current browser are a list browser.switch_to_window(window_handle): Toggles the window that window_handle points to browser.title: The title

Use the Python treq on twisted for HTTP stress testing _python

Doing API-related work is challenging, and keeping the system stable and robust at peak times is one of the reasons why we do a lot of stress tests in Mailgun. For so long, we've tried a variety of ways, from simple apachebench to more sophisticated custom test kits. But this post is a way to use Python for "fast rough" and very flexible stress testing.When using Python to write HTTP clients, we all like t

Selenium+python Automated Testing

From selenium import WebdriverImport UnitTestImport Importlib,sysImport timeImportlib.reload (SYS)Sys.getdefaultencoding ()Class Testlogin (UnitTest. TestCase):#指定浏览器def setUp (self):Self.driver = Webdriver. Firefox ()#打开URLSelf.driver.get ("http://192.168.33.133:7001/console/login/LoginForm.jsp")def test_login (self):#登录操作title = Self.driver.titlePrint (title)Now_url = Self.driver.current_urlPrint (Now_url)J_username = "WebLogic"J_password = "Weblogic123"Time.sleep (5)#执行登录#用户名定位self.driver.fin

Python+selenuim+django Web Automation testing, opening the service opens the browser.

The first time to use Python Django to do page automation, encountered some problems. Now do the recording.The desired effect:In the test interface, click the button to submit the test data and execute testcase. Then open the corresponding browser to execute.The actual problem encountered:Turning on the Django service opens the browser.The query problem is caused by driver= webdriver. Chormen () is executed at initialization. So the browser always ope

Python implements interface testing

There are many types of interfaces, but we often meet the two kinds of get and post that we often use. What is the difference between the two? Personal understanding is mainly expressed in terms of safety.Python code post arbitrary HTTP data and the method of using cookies, the need for friends can refer to.1), when not using cookies, it is very simple to send an HTTP post:Import URLLIB2, Urllib data = {' name ': ' www ', ' password ': ' 123456 '}f = urllib2.urlopen ( url = ' Http://w

Selenium+python Automated Testing (ii) Simple operation of the browser

1. MaximizingMaximize_window1 #coding = Utf-82 3 fromSeleniumImportWebdriver4Chromedriver ="C:\Program Files (x86) \google\chrome\application\chromedriver"5Browser =Webdriver. Chrome (Chromedriver)6 7Browser.get ('http:\\www.baidu.com')8 Browser.maximize_window ()9BROWSER.FIND_ELEMENT_BY_ID ('kw'). Send_keys ('Selenium')TenBROWSER.FIND_ELEMENT_BY_ID ('su'). Click () One ABrowser.quit ()View CodeFound the operation time error:Selenium.common.exceptions.WebDriverException:Message:disconnected:un

Python Learning note Five: errors, debugging, and testing

greatest common divisor $ defshow_factor (num): -Count = num//2#except 2 - whileCount > 1: the ifNum% Count = =0: - Print('%d The largest approximate number is%d'%(num, count))Wuyi Break theCount-= 1 - Else: Wu Print('%d is the prime number!! '% num)#Execution is all done and executed. - Aboutnum = Int (33) $ Print(Show_factor (num)) - #try...else ... - Try: -int'ABC') A exceptvalueerror as Reason: + Print('something went wrong.'+str (reaso

Python---redis in Windows installation and testing

Manuals and http://www.runoob.com/redis/redis-install.html, as well as start-up and testingPython installation of the Redis modulePIP3 Install RedisPython Code Preliminary:Redis-py provides two classes of Redis and Strictredis for implementing Redis commands, Strictredis is used to implement most of the official commands, and using official syntax and commands, Redis is a subclass of Strictredis, For backwards compatibility with older versions of Redis-pyImport = Redis. Redis (host="localhost"

Python Unit Test Framework UnitTest

Python Unit Test frameworkAuthor: Steve Purcell, Translation: Heiz, Project website: http://pyunit.sourceforge.net/Directory Overview System Requirements Use Pyunit to build your own tests Installation Test Case Introduction Create a simple test case Multiplexing Setup codes: Creating firmware Test case classes that contain multiple test methods Aggregating test cases into test suites Nes

The role of "Python decorator" in function testing

"Introduction" We often need a multi-function for time-consuming testing, there are many methods of testing, here the decorator's method, improve the time-consuming test code reusability, and other aspects of the application. The "design principle" class should be open to extensions and closed for modifications. "Code" (1) defines the decorator specific method#Encoding:utf-8" "Created on 2016?? 12?? 7?? @fi

Use Python's treq on twisted for HTTP stress testing

API-related work is challenging, and maintaining the stability and robustness of the system at peak times is one of the reasons why we do a lot of stress testing at Mailgun. Over the years, we've tried many different ways, from simple apachebench to more sophisticated custom test sets. But this post is a way to use Python for "fast rough" but very flexible stress testing.When using

Python stress testing script

Python stress testing scriptThe purpose is to write a script and initiate multiple threads to call an interface to test a concurrency problem. The solution is to make the interface a page and use the http get request of python to access the query. Import urllibimport threadingfrom time import ctime, sleepdef t1 (func): for I in range (10): f = urllib. urlopen ("

Data-driven testing (Python)

/?logintpl=mnu=https%3A%2F%2Fwww.baidu.com%2F") driver.find_element_by_id ("Tangram__psp_3__username"). Clear () driver.find_element_by_id ("tangram__psp_3__ UserName "). Send_keys (k) driver.find_element_by_id (" Tangram__psp_3__password "). Clear () driver.find_element_by_id ( "Tangram__psp_3__password"). Send_keys (v) driver.find_element_by_id ("Tangram__psp_3__submit"). Click () Time.sleep ( 3) Driver.close ()Operation Result:>>> =================== RESTART ================================>>

Testing the performance of Python awk sed when reading a file at a specified location

#!/bin/env python#coding: UTF8‘‘‘awk prints the specified number of rowsSED prints the specified number of linesPython prints the specified position, a length stringAwk takes the longest, a long timeSed awk time HalfPython time-consuming basic negligibleWhen you use a script to monitor log files, the location of the last exit is loggedPython is the most efficient.‘‘‘Import OSFrom time Import timeFrom Os.path import GetSizetestfile= '/dev/shm/%s '% tim

Total Pages: 15 1 .... 11 12 13 14 15 Go to: Go

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.