Chrome browser: chrome://inspect/#devicesThen open the public number page, refresh the browser page, will appear webview version number 57.0chromedrive Download1. Find WebView's Chrome version number, then download the corresponding Chromedriver driver package, 57 of the webview corresponding to the 2.28 driver: Chromedriver version downloadWhere should I put it after 2.chromedriver download? First find out where the chromedriver=2.30.477700 version of the error is from, replace it. Find path:
ANDROID-SDK, cmd open input adb, "Android Debug Bridge version 1.0.39" shows that the current ADB version is 1.0.39, which is referred to as version 39
adb
2. Check the ADB version number of the Night God Simulator (NOx) to find the installation path: \nox\bin, there is a nox_adb.exe, in fact, is adb.exe, in order to avoid conflict in the NOx change a name. Enter CMD in the upper-left corner of the address bar3. Then in the CMD reference input nox_adb, you can see the NOx inside t
The first five sections mainly introduce the environment construction and the use of the requests library, which can be used to send the interface request. But how to manage the interface case? Returns how the results are automatically verified? This is not possible with the above five sections, so from this section we have introduced the Python Unit Test framework unittest, which handles batch use case management, verifying return results, initializa
Write in front:
Appium environment is set up, Genymotion Simulator is also configured OK, then began to write the first demo
First, get the APK package name
Open cmd, enter the instruction AAPT dump badging D:\test\xxx.apk (full name of the APK, such as magic Diffuse camera apk). If the package name is obtained through Appium, it may not be accurate.
Package Name: com.manboker.headportrait
Ii. acquisition of Launcheractivity
Take the previous step, and th
', ' Port ', ' bs__name ') #正向查找bs的名字 for row in objs:row[0]row[1] Model operation-CREATE TABLE: User table (ID, user,pwd,email,mm) line of business (ID, name) # User table _set Host table (ID host port BS) user line of Business relationship table (ID UID Bid) ****** 1 1 2 11-obj = modes.userinfo.objects.filter (user= ' Japanese elder brother '). First () Obj.mm.add (1) obj.mm.add (11) # Japanese brother responsible for the Line of business (line of Business objects), line of business object,
(Os.path.dirname (Os.path.realpath (__file__))) # Locate the current folderJpgpath = Os.path.join (Parpath, ' testdata ', ' 1.jpg ') # "TestData": the folder name where the file is stored, "1.jpg": File nameClass Testsendfile (UnitTest. TestCase):@classmethoddef setupclass (CLS):CLS.S = Requests.session ()# Instantiate the called ClassCls.login = Loginzentao (CLS.S) # Instantiate class Loginzentao as ObjectCls.send = SendFile (CLS.S) # Instantiate the Class SendFile () as an objectdef test_01 (
# 1, requests inside with parser to dictionaryPrint(r.json())Print(type(R.json()))# Remove the ' result_sk_temp ' field from the JSON# {"ResultCode": "$", "Reason": "Query succeeded", "result": {"SK": {"temp": "" "," Wind_direction ":" Southeast Wind "," wind_strength ":" Level 2 "R.json()["Result"] [' SK '] [' temp ']Print(result)# 2, JSON module to dictionaryJsonPrint(json.loads(r.text# JSON-formatted STR turn dictPrint(type(json.loads(r.text)))# View What is returned, is the dictionary format
output result 2%: Modulo-Returns the remainder of the division.Example: b% A output result 0* *: Power-Returns the Y power of X.For example: A**b is 10 of the 20-time side, the output result 100000000000000000000: Take division-Returns the integer part of the quotientFor example: 9//2 output result 4, 9.0//2.0 output 4.0Attention:
>> 5/2//No decimal place when the division operation gets an integer
2
>> 5.0/2
2.5Compare (relational) operators:The following assumes th
": - Wuyi Print("QQ Exchange Group: 226296743") the - Print(Is_result_pass ()) Wu -```Operation Result:```The test process has not passed the use case: Pass 2 Failure 1 Error 1False```2. Add a judgment before the last email```1 if notIs_result_pass ():2 3 #determine if the HTML report has an error4 5 6 7 #execute the Send mail function, write your own e-mail function8 9 #send_mail (sender, PSW, receiver, Smtp_server, Report_file)Ten One A -
fromSelenium.webdriver.support.uiImportwebdriverwaitclassYoyo (object):"""Two packages were made based on the native selenium framework.""" def __init__(self):"""Start browser parameterization and start Firefox by default."""Self.driver=Webdriver. Firefox ()defget (self, url):" "To open a URL by using get" "self.driver.get (URL)defFind_element (self, locator, timeout=10): " "positioning element Method encapsulation" "element= webdriverwait (Self.driver, timeout, 1). Until (ec.presence
()Driver.quit ()Four, login function1. Although the code above can be logged in, the entire code is no more readable than the journal. If I want to change account login, this time also have to find the login account and password location, relatively time-consuming.2. We can write two functions for login and exit, so it looks more comfortable.3. parameterize the login account and password# Coding:utf-8From selenium import WebdriverImport timedef login (driver, user, password):"Login to GitHub"#
exceptions1. If no element is found, throw an exception, return false2. Return Ture If the element is found3. However, this method has a disadvantage, if there are more than one element on the page, it will also return ture (that is, as long as there are elements on the page to return ture, no matter how many)Iv. Reference Code# Coding:utf-8From selenium import WebdriverDriver = Webdriver. Firefox ()Driver.implicitly_wait (10)Driver.get ("http://www.baidu.com")def is_element_exist (CSS):s = Dri
the httprespon, which directly allows the dictionary to be serialized and returned to the front end.>>> from django.http import JsonResponse>>> response = JsonResponse({‘foo‘: ‘bar‘})>>> response.content‘{"foo": "bar"}‘The default is to pass in only one dictionary, and the data that the API returns should be a dictionary. However, if you must serialize a different type, such as a list, you can set the safe parameter:>>> response = JsonResponse([1, 2, 3], safe=False)If you want to customize the
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.