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 result with the expected result, and then write th
is processed" return f (x, y) A = Fxy (3,6,min) # min is a built-in function, the minimum value B = Fxy (3,6,max) # Max is a built-in function that asks for the maximum value C = Fxy (3,6,POW) # POW is a built-in function, exponentiation. 3 of the 6-time Square is 729print (a,b,c)HomeworkPayroll Management SystemAlex 100000Rain 80000Egon 50000Yuan 30000-----above are info.txt file-----Implementation results:Read employees and their payroll information from the Info.txt file, and finally write t
ObjectiveSometimes it is not easy to find an element on the page by the attribute of the element, and you can crawl the information from the source. Selenium the Page_source method can get to the page source code.Selenium of the Page_source method is rarely used, small make a recent look API accidentally found this method, so the whim, here combined with the Python re module with regular expression crawled out of all the URL address on the page, can b
assignment is placed in the variable argument list, and the specific process 3:In addition, in the process of analysis, the following conditions should be excluded to end the analysis ahead of time. The first case is that the IF statement has Os.path.exitst,isdigit with controllable parameters and contains a return statement, such as (if not os.path.isdir ( Parentpath):return None); The second case is to lock the controllable parameter in a certain value range and return it directly, as (if typ
------"
data = Json.dumps ({"userid": 1, "token": "868d26e05666c5aaeb76d361faa7448c", "ArticleID": [3,4,5]}) #
r = Requests.delete (' http://localhost:8080/delete/', data = data)
Print R.status_code
Print R.text
Print type (R.json ())
Print str (R.json ())
DescriptionIf these interfaces are requested in some interface request plug-ins (such as Httprequester), there is no space between key-value pairs when the parameter is passed, and the string must be enclosed in do
!.Another way to execute a python script, modify the test.py file:#!/usr/bin/pythonPrint "Hello, python!"To run the program:chmod +x test.py#./test.pyHello, python!.Using Chinese in script mode programmingPython uses ASCII code by default, does not support Chinese, the Chinese language needs to be declared to support the Chinese character set, generally utf8, the
Using Python for report automation ~This article will cover:
XLWT Common functions
XLRD Common functions
Xlutils Common functions
XLWT application of formulas when writing Excel
XLWT writing to a specific directory (path setting)
In the XLWT Python language, an extension tool that writes to an Excel file. You can implement
ObjectiveThere are a lot of small partners in the installation of selenium environment after the Firefox error, because now selenium upgrade to 3.0, and 2.0 of the version there is a little difference.There are three main pits encountered during the installation environment:1.' geckodriver ' executable needs to is in PATH2.expected browser binary location, but unable to find binary in default location3.unsupported Marionette Protocol version 2, required 3Environment Preparation:--python3.6--sele
from the previous encapsulated Excel method, as test test Selenium2+python Automation 58-read Excel data (XLRD)2. Make some changes based on the previous written login, test parameters read the data in Excel Selenium2+python Automation 48-Login method (parametric)3. The code reference is as follows# test DataTestData
in the world can be classified, and all things are objects.
Just say: The object belongs to a certain kind of
As long as the object, there must be attributes
Second, Characteristics:
Class: An abstraction, blueprint, and prototype of an object that has the same attributes as an alien. In this class, you define the properties and common methods that these objects have.
Object object: An instance of a class that is instantiated after it has to be in
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.