-Self.assertequal (assertt,self.verificationerrors,msg="validation failed! ") - #断言: Actual result, expected result, error message in self.driver.quit () - to def test_creat (self): + """add a new record in Notepad""" -SELF.DRIVER.FIND_ELEMENT_BY_ID ("Com.smartisan.notes:id/add_button"). Click () theTime.sleep (3) *Self.driver.find_element_by_class_name ("Android.widget.EditText"). Send_keys ("Today is a good day to study at home! ") $SELF.DRIVER.FIND_ELEMENT_BY_ID ("Com.smartisan.note
‘]=‘.XXSearchActivity‘
desired_caps[‘unicodeKeyboard‘]=True
desired_caps[‘resetKeyboard‘]=True
driver = webdriver.Remote(‘http://localhost:4723/wd/hub‘, desired_caps)
driver.find_elements_by_name("搜索话题")
driver.find_element_by_class_name("android.widget.EditText").send_keys(u"可爱")
# driver.find_element_by_id(‘et_searchactivity_search‘).send_keys(u"可爱")
driver.find_element_by_name("搜索").click()
Time.sleep (5)//Pause on page for 5 seconds
driver.quit()
From for not
intermediate error, the system open too many fileswith open(‘/path/to/file‘, ‘r‘) as f: print f.read()If the file size cannot be determined, repeated calls to read (size) are insured; if it is a configuration file, calling ReadLines () is the most convenient:for line in f.readlines(): print(line.strip()) # 把末尾的‘\n‘删掉2. Read binary filesThe default is to read the text file, and it is an ASCII-encoded text file. To read a binary file, compare slices, videos, and so on, open the file in ' RB
. Install Appium,cmd under Administrator Rights Command installation: NPM install-g [email protected]; Note the latest version of the installation Appium will be reported to install failed at the [email protected] error;-can omit this step, directly install appiumforwindows_1.4.16.1 try;4, install the appiumforwindows_1.4.16.1, after the installation of the configuration
not FountThe device is connected properly, the device is disconnected and the device is not found.
Push
Copy your computer's local files to your mobile device
Pull
Pull phone device files to local
Install
[-LRTSD]
Install APK-L: Identity app as restricted app-R: Replace installation-T: Run the Install test package-S: Install to SD card-D: Allow downgrade installation
Poptest is the only training institute for developing Test and development engineers in China, aiming at the ability of the trainees to be competent in automated testing, performance testing and testing tools development. Poptest Test Development Engineer Employment Training please consult qq:908821478) Mobile automati
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.hea
First, install the Python libraryThere are many ways to install the Python library, such as PIP installation, source file installation, and run package installation, but the most common use is to install with PIPAppium+python do the automated testing of the mobile end, you need to install the following Python library, open the cmd command:InstallationAppium-Python-ClientPip Install
Write in front:This article describes the identification of the elements of the tools and elements of the positioning method, the tools to identify elements are mainly uiautomator and monitor, as well as Appium Inspector (small series under the windows in the 1.7.0 version can be used, 1.4.16 version is not available), This series of tutorials with the appium1.4.16 this article, it is not introduced Appium
;Importorg.testng.annotations.Test; Public classXXXX {PrivateWebdriver Driver; @BeforeMethod Public voidSetUp ()throwsException {//Set up Appium//file Classpathroot = new file (System.getproperty ("User.dir")); //file Appdir = new file (classpathroot, "Apps/contactmanager"); //file app = new file (appdir, "contactmanager.apk");Desiredcapabilities capabilities =Newdesiredcapabilities (); Capabilities.setcapability ("DeviceName", "XX");//xx can be the m
Poptest is the only training institute for developing Test and development engineers in China, aiming at the ability of the trainees to be competent in automated testing, performance testing and testing tools development. If you are interested in the course, please consult qq:908821478. TouchlongclickPackage Io.appium.android.bootstrap.handler;Import Android.os.S
positioning method. The difference is that the relative path location of the//after only can be connected to the Android class properties or *.Driver.find_element_by_xpath ('//android.widget.edittext[@text = "QQ number/Mobile number/email"])IosIOS10 after using the Xcuitest framework, the native framework does not support xpath,appium conversion, and is not recommended for slow speed.4, UiautomatorAndroid'
Appium Installation1. Installing Nodejs2. Installing AppiumiOS Side Environment installation1. Install Xcode2. Install Xcode Command Line ToolsAndroid Side Environment installation1. Download and install the JDK, set the JAVA_HOME environment variable (: reference website)2. Download and install the SDK, set the ANDROID_HOME environment variable (: reference website)Environment validation: Execute CMD command node
Poptest is the only training institute for developing Test and development engineers in China, aiming at the ability of the trainees to be competent in automated testing, performance testing and testing tools development. Poptest Test Development Engineer Employment Training please consult qq:908821478) Mobile automati
Continue to build the appium environment.
Section II installs the Android development environment
If your environment is a Mac then you can skip this section directly. Just as we were using selenium for Web automation testing, we needed a browser to execute the test script. So the mobile-end automated test, we also need an Android phone (
Poptest is the only training institute for developing Test and development engineers in China, aiming at the ability of the trainees to be competent in automated testing, performance testing and testing tools development. If you are interested in the course, please consult qq:908821478. ScrollToPackage Io.appium.android.bootstrap.handler;Import Com.android.uiauto
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.