ObjectiveTo unittest here can basically build a simple project framework, we can use a run_main.py script to control the execution of all the use cases, and generate reports, send messages a series of actionsFirst, the new project1. Open the upper-left corner of Pycharm file>new project, enter the project name in location: D:\test\test_blog2. Once created, select Opin in the current window toII. Structure of the project1. Under test Engineering, create a folder, be sure to choose the way
in your Excel data, you must right-click the format format of the cell, or the data you read is floating point(Set cell format after editing, edit success in the upper left corner has a small triangle icon)Four, package Read method1. The final data read is the list type data of multiple dictionaries, the first row of data is the key value in the dictionary, and the value values are corresponding to the second line.2. The code after encapsulation is as follows# Coding:utf-8Import xlrdClass Excel
is called in Python, and you can use the win32comThe code is as follows:def deletequicklaunchontaskbar (lnkname): Objshell = Win32com.client.Dispatch ("shell.application") Taskbarpath = Os.path.join (os.environ["AppData"], R ' microsoft\internet explorer\quick launch\user pinned\taskbar ') lnkname = Desktopcommon.tounicode (lnkname) objfolder = Objshell.namespace (taskbarpath) DesktopItems = objFolder.Items () for item in De
Python is a 3.5,chrome browser version in early 17.1.chromedriverDownload a chromedriver in http://chromedriver.storage.googleapis.com/index.html?path=2.30/, unzip the exe paste into the chrome installation path, Generally in program Files (x86) \google\chrome\application2. Installing the Selenium LibraryOpen the console and enter the command: Pip install SeleniumIf PIP is not installed, then search keywords: pyth
corresponds to the method of the HTTP request. is commonly used for get and post requests. A GET request is typically a query for resource information. Post is typically updated with resource information. 1.1 Viewing the use of Get functions >>> Help (requests.get) #查看requests库的属性get请求函数的使用 NBsp Help on function get in module requests.api:get (URL, Params=none, **kwargs) sends a get request.:p aram ur L:url for the New:class: ' Request ' object.:p Aram params: (optional) Dictionary or bytes
under the Scripts folder2. Input directive:Pip.exe Install selenium If the progress bar is shown to 100%, it is already installed (if the abnormal cause is exited and you know the progress is up to 100%)3. Selenium can support a lot of browsers, but to install the corresponding browser driver , such as My computer's browser is v56, the corresponding download chromedriver version v2.29(Chrome is used in the notes, and other browsers are similar, so you can check it yourself)1.3 What is Webdriver
I. PrefaceAppium is one of the most popular automation frameworks for apps, and its main advantage is Android and iOS, and the scripting language supports both Java and Python. The gadget is good at Python, so the next tutorial is an example of Appium+python.Learning Appium The biggest difficulty lies in the installation of the environment, 80% of the people died
Project IntroductionTwo times development Uiautomatorviewer optimized locator generation, support the generation of Java,python Automation code, repair the self-brought tool screen has a dynamic load failure problem, optimize the tool speed, to achieve similar recording script function. Compatible with iOS Android.Software architectureThis tool takes the Android SDK to bring Uiautomatorviewer as the source
Background:
In the automated testing industry, individuals feel that the main language is Python, java. This discussion is based on the Python automation framework design and case development, using Python know its benefits, but according to the actual project needs have a lot of oncoming difficulties-host migration,
Download plugin:
Python:https://wiki.jenkins-ci.org/display/jenkins/python+pluginRobotframework:https://wiki.jenkins-ci.org/display/jenkins/robot+framework+pluginSelenium:https://wiki.jenkins-ci.org/display/jenkins/selenium+plugin
Plugin use:
Place the downloaded. hpi file in this directory:D:\apache-tomcat-7.0.67\webapps\jenkins\WEB-INF\plugins (Tomcat installation directory)
Whether the plugin was installed successfully
The content of this section1, Isinstance (OBJ,CLS) and Issubclass (Sub,super)2. Reflection3, __setattr__,__delattr__,__getattr__
I, Isinstance (OBJ,CLS) and Issubclass (Sub,super)
1. Isinstance (obj,cls) Check if obj is an object of class CLSClass Foo (object): passobj = Foo () print (Isinstance (obj, Foo)) # True2, Issubclass (sub, super) check if the sub class is a derived class of super classClass Foo (object): passclass Bar (foo): passprint (Issubclass (
List of data types for 1.pythonThe list is one of the most common data types in the Python development language, and can be used to make additions and deletions to the data.Definition of a list: examplesnames = ["Lucy", "Lily", "Jack"]Common features of the list1) Remove the elements from the list: example Take out the second element of the list: by subscript, the subscript is counted starting at 0. Remove the last element of the list:
do compatibility.2. First use Driver.name to get the browser name, and then use the IF statement to make a judgmentVII. Compatibility1. Compatible with Google and firefox/ieEight, the reference code is as follows:# Coding:utf-8From selenium import WebdriverDriver = Webdriver. Firefox ()Driver.get ("https://www.baidu.com")Print Driver.name# Back to the topDef scroll_top ():if driver.name = = "Chrome":JS = "var q=document.body.scrolltop=0"ElseJS = "var q=document.documentelement.scrolltop=0"Retur
set to false unsuccessful"Tryself.driver.find_element_by_id ("Input1"). Send_keys (U "Shanghai-leisurely")self.driver.find_element_by_id ("Input2"). Send_keys ("xxx")# login ID is wrong, positioning will throw exceptionself.driver.find_element_by_id ("Signin"). Click ()# Determine if the Login Success page has an account: "Shanghai-leisurely"Time.sleep (3)Locator = ("id", "lnk_current_user")result = Ec.text_to_be_present_in_element (locator,u "Shanghai-Yo") (self.driver)Self.assertfalse (Result
ObjectiveWhat does the SDK manager have to install?First, the SDK Manager1. Double-click Open SDK Manager interface2.Tools inside the top three is a must download--android SDK Tools has a variety of utilities, such as: Uiautomatorviewer,uiautomatorviewer,uiautomatorviewer--android SDK Platform-tools There are adb,adb,adb--android SDK Build-tools There are appt,aapt,appt3.SDK platform Next up, it can be backwards compatible.4.Extras here, choose the following three.--android Support Respository A
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.