夜鸥 发布的文章

  1. Swift 4.0内置 API :XCUIelement

    tap(),doubleTap(),twoFingerTap(),press()...
  2. monkey测试本身是混沌随机,模仿什么都不懂的猴子在APP中乱点,抽象其动作就是点,划(忽略其喜好,那么操作是水平分布的)
  3. 遍历api随机触发事件即可完成monkey模拟

简介:Hocon是Json和Properties的超集,可以完全兼容两种格式

C Sharp下的实现

https://www.cnblogs.com/sunjie9606/p/5163302.html
https://github.com/akkadotnet/HOCON

Python支持

https://github.com/chimpler/pyhocon

Java支持

https://lightbend.github.io/config/

使用方法

from pyhocon import ConfigFactory
conf = ConfigFactory.parse_file('samples/database.conf')
host = conf.get_string('databases.mysql.host')
same_host = conf.get('databases.mysql.host')
same_host = conf['databases.mysql.host']
same_host = conf['databases']['mysql.host']
port = conf['databases.mysql.port']
username = conf['databases']['mysql']['username']
password = conf.get_config('databases')['mysql.password']
password = conf.get('databases.mysql.password', 'default_password') #找不到key使用默认值


import os
from selenium import webdriver
desired_caps={}
desired_caps['platformName']='Android'
desired_caps['platformVersion']='9'

Appium (default) or Selendroid or UiAutomator2 or Espresso for Android or XCUITest for iOS or YouiEngine for application built with You.i Engine

desired_caps['automationName']='UiAutomator2'

desired_caps['deviceName']='D3H7N18125005455'
desired_caps['app']='C:\Users\NXQ\Desktop\ContactManager.apk'
desired_caps['app-package']='com.example.android.contactmanager'
desired_caps['app-activity']='com.example.android.contactmanager.ContactManager'
desired_caps['waitappActivity'] = 'com.example.android.contactmanager.ContactManager'

driver=webdriver.Remote('http://localhost:4723/wd/hub',desired_caps)
el=driver.find_element_by_name('Add Contact')
el.click()

textfields=driver.find_element_by_tag_name('textfield')
textfields[0].send_keys('My Nmae')
textfields[2].send_keys('someone@some.com')

driver.find_element_by_name('Save').click()
driver.quit()

iOSNsPredicateString

UIselector