51Testing软件测试论坛

标题: 还是习惯来这里,求大神帮忙解决一个python+appium的问题 [打印本页]

作者: leisijun    时间: 2016-12-5 22:07
标题: 还是习惯来这里,求大神帮忙解决一个python+appium的问题
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)
作者: Miss_love    时间: 2016-12-6 10:24
隐藏键盘干啥?
作者: ah606    时间: 2018-6-6 14:28
这是个问题




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2