TA的每日心情 | 奋斗 2016-12-12 22:10 |
---|
签到天数: 12 天 连续签到: 1 天 [LV.3]测试连长
|
python脚本:
#! /user/bin/env python
# -*- conding:utf-8 -*-
from appium import webdriver
from time import sleep
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '5.0.1'
desired_caps['deviceName'] = 'samsungS5'
#desired_caps['app'] = 'C:\commonApp_V0.8.0.0_svn6237_20160527.apk'
desired_caps['appPackage'] = 'com.qihoo.appstore'
desired_caps['appActivity'] = '.home.MainActivity'
desired_caps['newCommandTimeout'] = '9999'
desired_caps['noReset'] = 'True'
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
sleep(1)
driver.find_element_by_id('search_hint_view').click()
sleep(1)
driver.find_element_by_id('com.qihoo.appstore:id/search_edit').clear()
driver.find_element_by_id('com.qihoo.appstore:id/search_edit').send_keys('123456')
sleep(1)
#--------隐藏键盘---------
driver.hide_keyboard()
sleep(1)
#--------App置后台5秒后再运行---------
driver.background_app(5)
sleep(1)
Appium报错信息
--------App置后台5秒后再运行---------报错
> info: [debug] Getting focused package and activity
> info: [debug] executing cmd: F:\autotest\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 14989b1c shell "dumpsys window windows"
> error: com.qihoo.appstore/.search.SearchActivity never started. Current: com.qihoo.appstore/.home.MainActivity
#--------隐藏键盘---------报错
info: [debug] Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command. (Original error: Soft keyboard not present, cannot hide keyboard)","origValue":"Soft keyboard not present, cannot hide keyboard"},"sessionId":"ce953c1b-d85a-429b-ab92-b30b0bb52b01"}
python解释器报错:
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. (Original error: Soft keyboard not present, cannot hide keyboard) |
|