UnitTest is a unit test framework that is a unit test framework for Python programming. Sometimes it is called "Pyunit", which is the Python language version of JUnit. Here, JUnit is the Java Language Unit test framework, Java has a very useful unit test
your car.
4. Unit Test JUnit
http://www.ibm.com/developerworks/java/tutorials/j-junit4/
5. The way the frame is built
Http://www.infoq.com/cn/news/2013/12/humble-architects
rule 4: Bottom-up consistency is better than top-down consistency
I have a way to achieve more consistency in the system: Create a reference application and use an easy to follow architecture. If this is done well, developers will always remember not to deviate from the archit
Packagecn.mf.b_test;ImportJavax.annotation.Resource;Importorg.junit.Test;ImportOrg.junit.runner.RunWith;Importorg.springframework.test.context.ContextConfiguration;ImportOrg.springframework.test.context.junit4.SpringJUnit4ClassRunner;ImportCn.mf.bean.User;//help us create a container@RunWith (Springjunit4classrunner.class)//specify which configuration file to use when creating the container@ContextConfiguration ("Classpath:applicationContext.xml") Public classDemo {//injecting an object named us
Self.assertisnone (result,msg="%s is not none"%(result))def test09 (self):#Determine if a parameter does not contain another parameterPrint"Execute test Case 09") result =‘123‘ Self.assertisnotnone (Result,msg= " %s is None "%def TearDown (self): U No post-conditions can be written Passprint ( " end ... ") # Passif __name__ = = __main__ ": Unittest.main () Ps:unittest executes the setup, executes the test case test* (the test case is executed in the name order), and finally executes the tear
Before saying that I wrote a selenium automation framework, and then study the lower RF, I think the RF based on the keyword-driven framework is more easy to get started, of course, do some of the more cumbersome verification, it seems not too flexible, It's better to write a few lines of Python's benefits (or maybe you haven't mastered it yet), but overall, ther
Full Stack Engineer Development Manual (author: Shangpeng)
The Python tutorials all solution needs Environment browser (firefox/chrome/ie. Python Selenium Selenium IDE (if using Firefox) FireBug, Firepath (if using Firefox) chromedriver, Iedriverserver, Phantomjs.exe IDE (Pycharm/sublime/eclipse.. )
1, browsers suggest using Firefox or Chrome, do not use the latest version, to use the early two to three ver
1. The entire framework directory is as follows:Constant: Store some constants, such as the URL of the test, and the elements that some PR methods need to use;Errorpicture: Used to store errors during automatic operation;Framework: Classes and methods for storing some basic;Pages: a page class for storing pageobject;Publicmethod: Used to store some PR methods;Question: Used to store some problems encountere
positioning of the page, and the method encapsulated by the business operation code associated with those elements.4. Code reuse, which reduces the amount of test script code.5. Clear hierarchy, while supporting the development of multiple writing automation scripts, such as how many pages each person writes, does not affect others.6. It is recommended that both the page class and the business logic approach give a meaningful name to make it easy for others to quickly write scripts and maintain
test whether it can work properly, only a few statements: # Test Selenium installation, selenium can open Chrome browser from selenium import Webdriverbrowser = Webdriver. Chrome () browser.get ("https://www.baidu.com/") print (Browser.title) browser.quit ()At this point, how to open the browser and automatically access the Baidu Web site, then the installation
Architecture
This framework is created using ant, testng and selenium.Through this framework, a user is able to create an automatic test case which can be run later by executing a single command. The uses of different frameworks are as follows:Selenium: this framework is needed for recording a testcase, exporting it into Java, and executing it on a browserTestng
SeleniumIsWebOfAutomated TestingTools, andOthersCompared with the automated tools, the main features of the tool are cross-platform and cross-browser.SupportedWindows, Linux, Mac, supporting IE, FF, Safari, opera, chrome, etc.Another feature is the support for distributedTest CasesTo distribute test cases to different test machines, which is equivalent to the distribution machine function.
For the principles, architecture, and usage of selenium, refer
调试十分困难。 Because the page may have a lazy load situation. Although the page has been rendered, there may be ajx lazy loading. Some elements need to wait until the AJAX call is complete before they can be displayed. At this point, you need to add a wait mechanism on the page./** * 用于等待某个元素出现,软等待 * @param by */public boolean wait(final By by){ new WebDriverWait(driver, 10).until(new ExpectedConditionFor example, you want to find an element that id= "name":if (wait(By.id("name"))) xxx;else
operation interface to manipulate page elements.On the other hand, Webdriver can interact with the system bottom and send the action signal directly. such as what keys to press, where to move the mouse and so on. Visible selenium2.0 is much more powerful than 1.0. Here is a brief talk about Webdriver:Webdriver My understanding:He's kind of an API, a specification.A variety of browser vendors refer to this specification to give the selenium the inter
Previous Test framework: http://www.cnblogs.com/tobecrazy/p/4553444.htmlWith Jenkins sustainable integration: http://www.cnblogs.com/tobecrazy/p/4529399.htmlUse log4j 2:http://www.cnblogs.com/tobecrazy/p/4557592.html in the test frameworkTo start with the grid, selenium grid is a framework for executing test cases with different platforms (Windows, Linux, Android
Previous Test framework: http://www.cnblogs.com/tobecrazy/p/4553444.htmlWith Jenkins sustainable integration: http://www.cnblogs.com/tobecrazy/p/4529399.htmlUse log4j 2:http://www.cnblogs.com/tobecrazy/p/4557592.html in the test frameworkTo start with the grid, selenium grid is a framework for executing test cases with different platforms (Windows, Linux, Android
selenium sub-version 1 and version 2, where the installation is version 2 of the selenium. 650) this.width=650; "src=" Https://code.csdn.net/assets/ico_fork.svg "alt=" derived to My Code slice "width=" "height=" "/>"#-*-coding:utf-8-*-fromseleniumimportwebdriverfrom selenium.common.exceptionsimporttimeoutexceptionfrom selenium.webdriver.support.uiimportwebdriverwait#availablesince2.4.0 importtime#createane
Frame Design Illustration:650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/80/F7/wKioL1dFjXuDuDEzAAhEjEalRlk754.jpg "title=" Python +selenium+unittest Automation framework illustration. jpg "alt=" wkiol1dfjxududezaahejealrlk754.jpg "/>Preparation before the framework is implemented:The 1.Python version is installed under Windows 2.7.11.2. The latest ver
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.