繁体   English   中英

在python和appium中,为什么不能使用send_keys()来输入框

[英]In python and appium,why can't use send_keys() to inputbox

descr:当我使用 send_keys("xxx") 输入框时,有人告诉我

selenium.common.exceptions.InvalidElementStateException:消息:无法将元素设置为“15323423456”。您是否与正确的元素进行了交互?

这是什么原因? 这个插件是太高还是太低? 我的XPath没有错所以我解决不了,你愿意帮我解决这个问题吗?谢谢

代码:

                    'newCommandTimeout' :'3000',
                        'unicodeKeyboard': True,
                        'resetKeyboard': True,
                        "automationName": "UiAutomator2"
                        }
        self.driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", desired_caps)

    def testchangeto_pageone(self):
        time.sleep(3)
        WebDriverWait(self.driver, 10, 0.5).until(
            EC.presence_of_all_elements_located((By.XPATH, "//*[@text='login']")))
        self.driver.find_element_by_xpath("//*[@text='login']").click()
        self.driver.find_element_by_xpath("//android.widget.EditText[@index='0']").click()
        self.driver.find_element_by_xpath("//android.widget.EditText[@index='0']").send_keys("15323423456")

结果:

在此处输入图片说明

版:

  • 硒:3.1.4.1
  • appium:1.15.1
  • aapium-python-客户端:0.48

我知道是什么原因造成的,因为appium太高了。卸载并重新安装1.8.0

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM