Android Emulator (genymotion) +appium+python Framework performs the basic process:
1. Push.initdate (OpenID) method//Business Data initialization
1.1 v5db.push_to_db (filename, OpenID)///by executing the SQL statement in the filename file to initialize the business data, such as physically deleting orders, to ensure that automated execution fails for data reasons
2, Android.Android.init_Android (self)//Initialize Android simulator
classandroid:definit_android (self):Try: Desired_caps={} desired_caps['devicename'] ='Device'desired_caps['PlatformName'] ='Android'desired_caps['platformversion'] ='4.3'desired_caps['app'] = PATH ('d:\\workspace\\projectname_app_appium_test\ProjectNameapp\\agent4.0.0_test.apk')
desired_caps['Apppackage'] ='com.***.finance.agent'
desired_caps['appactivity'] ='com.***.finance.agent.luncheractivity'
desired_caps['Unicodekeyboard'] ='True'
desired_caps['Resetkeyboard'] ='True'
returnDesired_caps
exceptException,ex:
PrintEx
3, the web. Web.webpath (self, androidmap)//Plug the app-related information onto the appium running on the remote virtual machine to get the desired driver
Driver = Webdriver. Remote (' Http://127.0.0.1:4723/wd/hub ', Androidmap)
4, Push.controller (Driver)//formally start the execution of case
4.1 Read the case map and map out the description
4.2 If execution case can be matched to in the mapping table, the contents of the file are read by row, and case content is processed
Process case content, get the required parameters for execution 1) Ids_key->ids: Element ID 2) Ele_type: Element type 3) Input_value: Input 4) Msg: Step description Information 5) Assert_message: Checksum information
4.3 Call push.fillelement (driver,ids,ele_type,input_value,msg,assert_message)//Locate the element and manipulate it
4.3.1 positioning elements
4.3.2 Manipulating elements
4.3.3 Push.checkresut (Driver, Times, MSG, assertmsg, Input_value)//write element operation log
5, case file execution complete, driver. Quit ()//Close Driver
6. Push.loginfo (time)//Output Case test report
Android Simulator (genymotion) +appium+python Framework Execution Fundamentals (currently written by the company)