appium automatically registers complete scripts

I. Test environment

Win 10
Python 3.6
Appium 1.13.0
Andriod 5.1.1 Simulator
Testing App: Android version 3.1.0
selenium3

II. Test scenarios
Scenario 1: desired_caps ['noReset']='False'in the base script

1 Automatically install App (kaoyan 3.1.0.apk) and start App

2. Click on registration to upload avatars automatically

3. User information, password, mailbox, Click to register immediately

4 choose the right - Master - Master of Science - Science - Mathematics - Data Science.

5. Click on the Entrance Examination Band to complete registration

3. Reference Code

#uft-8
from find.base import driver,NoSuchElementException

import random
#After starting app, locate the registration button and click
driver.find_element_by_id("com.tal.kaoyan:id/login_register_text").click()
#On the registration page, click on the Avatar
driver.find_element_by_id("com.tal.kaoyan:id/activity_register_userheader").click()
#Get all the pictures
images = driver.find_elements_by_id("com.tal.kaoyan:id/item_image")
#Press index to select a picture and click
images[2].click()
#Finally, click Save Uploaded Pictures
driver.find_element_by_id("com.tal.kaoyan:id/save").click()
#Registration page
username = 'zwx2019'+'FLY'+str(random.randint(100,999))
print('username:%s' %username)
#Fill in User Information
driver.find_element_by_id('com.tal.kaoyan:id/activity_register_username_edittext').send_keys(username)
#Password completion
password = 'zwx'+str(random.randint(1000,9999))
print('password:%s' %password)
driver.find_element_by_id('com.tal.kaoyan:id/activity_register_password_edittext').send_keys(password)
#Mailbox:
email = '2019zwx'+str(random.randint(1000,9999))+'@qq.com'
print('email:%s' %email)
driver.find_element_by_id('com.tal.kaoyan:id/activity_register_email_edittext').send_keys(email)
#Click Register Now
driver.find_element_by_id('com.tal.kaoyan:id/activity_register_register_btn').click()

#Institutional choice
driver.find_element_by_id('com.tal.kaoyan:id/perfectinfomation_edit_school_name').click()
#Choose city
driver.find_elements_by_id('com.tal.kaoyan:id/more_forum_title')[0].click()
#Choose a university
driver.find_elements_by_id('com.tal.kaoyan:id/university_search_item_name')[1].click()
#Choice profession
driver.find_element_by_id('com.tal.kaoyan:id/activity_perfectinfomation_major').click()
#Academic Master--Science--Mathematics--Data Science
driver.find_elements_by_id('com.tal.kaoyan:id/major_subject_title')[6].click()
driver.find_elements_by_id('com.tal.kaoyan:id/major_group_title')[0].click()
driver.find_elements_by_id('com.tal.kaoyan:id/major_search_item_name')[6].click()
#Click on the Entrance Examination Band to complete registration
driver.find_element_by_id('com.tal.kaoyan:id/activity_perfectinfomation_goBtn').click()

IV. Operation results

 

Keywords: Python simulator Android

Added by piersk on Fri, 04 Oct 2019 00:23:06 +0300