zoukankan      html  css  js  c++  java
  • Appium发送中文或其他语言的问题

    1. 需要在配置信息中增加'unicodeKeyboard' = “True”字段,如下:

    def driver_weixin(platformVersion="6.0.1",deviceName='Galaxy A8'):
        desired_caps2 = {}
        desired_caps2['platformName'] = "Android"
        desired_caps2['platformVersion'] = platformVersion
        desired_caps2['deviceName'] = deviceName
        desired_caps2['udid'] = "75a2daf1"  
        #desired_caps2['automationName'] = 'UiAutomator2'
        desired_caps2['appPackage'] = 'com.tencent.mm'
        desired_caps2['appActivity'] = 'com.tencent.mm.ui.LauncherUI'
        desired_caps2['resetKeyboard'] = "True"   #隐藏键盘
        desired_caps2['unicodeKeyboard'] = "True"  
        return  desired_caps2
    

    2.测试代码中加入

    1 self.driver = webdriver.Remote("http://127.0.0.1:4725/wd/hub", desired_caps2)
    2 
    3 element = self.driver.find_element_by_xpath(xxxxx)
    4 
    5 SendContent = "我爱中华"
    6 
    7 element.send_keys(u"%s" % SendContent)
  • 相关阅读:
    Firefly 介绍
    9秒社团跨平台开发引擎CrossApp宣布正式开源
    页面置换算法
    Selenium
    C++虚函数、虚继承
    链表题目
    二叉树分类
    求连续子数组的最大和
    拓扑排序
    二叉树题目
  • 原文地址:https://www.cnblogs.com/Sandy-1128/p/appium-python-sandy-0306-3.html
Copyright © 2011-2022 走看看