简体   繁体   English

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

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

descr:when I used send_keys("xxx") to inputbox,I was told descr:当我使用 send_keys("xxx") 输入框时,有人告诉我

" selenium.common.exceptions.InvalidElementStateException: Message: Cannot set the element to '15323423456'. Did you interact with the correct element? " selenium.common.exceptions.InvalidElementStateException:消息:无法将元素设置为“15323423456”。您是否与正确的元素进行了交互?

what this coused by?这是什么原因? Is this plugin too high or too low?这个插件是太高还是太低? My XPath is not wrong so I can't solve it, would you like to help me solve this problem?thank you我的XPath没有错所以我解决不了,你愿意帮我解决这个问题吗?谢谢

CODES:代码:

                    '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")

RESULTS:结果:

在此处输入图片说明

Edition:版:

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

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

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

相关问题 无法send_Keys到硒python吗? - Can't send_Keys to selenium python? 为什么 send_keys function 在 Python Selenium 中不起作用? - Why send_keys function doesn't work in Python Selenium? 为什么我不能对硒列表中的元素使用send_keys() - Why can't I use send_keys() for an element out of a list in selenium 为什么我不能使用 Selenium 在 Python 中将密钥发送到 Twitch 搜索栏? - Why I can't send_keys to Twitch search bar in Python with Selenium? 无法使用 Selenium send_keys() 到 WYSWYG 编辑器 - Can't use Selenium send_keys() to WYSWYG editor 为什么 Selenium (Python) click() 或 send_keys() 不能到这个文本区域? (超时异常) - Why won't Selenium (Python) click() or send_keys() to this textarea? (TimeoutException) Python WebDriver-无法使用send_keys将文件上传到站点。 API将激活文件选择窗口 - Python WebDriver - can not use send_keys to uploading file to site. API will active file selection window 为什么我不能将“ send_keys”添加到含硒的文本框中? AttributeError:“ NoneType” - Why can't I “send_keys” to text box with selenium? AttributeError: 'NoneType' Python selenium send_keys 不起作用无法设置登录字段 - Python selenium send_keys not working can’t set login fields 如何在 Python Selenium 中随机使用 send_keys? - How can I use send_keys at random intervals with Python Selenium?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM