Appium 在字段上输入文本的其他方法
我需要在iOS Emulator上测试这个登录表单,但是当我尝试在元素Appium 在字段上输入文本的其他方法,appium,robotframework,Appium,Robotframework,我需要在iOS Emulator上测试这个登录表单,但是当我尝试在元素'//input[@name=“email”]上插入文本时,文本会被放入,但是当我选择元素'//input[@name=“password”]时,第一个元素的文本会消失,当我按下'//div[@id=“react component login header']//按钮/div/span[1]“元素 我认为这个问题与文本如何输入表单有关,因为使用Selenium2库(用于桌面)没有这个问题 有没有其他方法可以在字段中插入文本?
'//input[@name=“email”]
上插入文本时,文本会被放入,但是当我选择元素'//input[@name=“password”]
时,第一个元素的文本会消失,当我按下'//div[@id=“react component login header']//按钮/div/span[1]“
元素
我认为这个问题与文本如何输入表单有关,因为使用Selenium2库(用于桌面)没有这个问题
有没有其他方法可以在字段中插入文本?我在使用其他库或在Python上创建关键字来辅助测试方面没有任何问题(在其他测试中已经这样做了)
我已经试过了:
- 输入文本
- 输入值
- 输入密码(我知道,但我需要尝试其他方法)
我可以在字段中看到正在写入的文本,但当该元素的上下文丢失时,文本也会丢失。对于Android,我使用关键字“AppiumLibrary.Press Keycode”来解决问题 例如,发送“AppiumLibrary.Press Keycode 67”时,我设法发送了一个退格
对于Android,我使用关键字“AppiumLibrary.Press Keycode”解决问题 例如,发送“AppiumLibrary.Press Keycode 67”时,我设法发送了一个退格
我不知道你如何尝试输入文本。您可以尝试sendKey()方法
driver.findElementById(“元素id”).sendKey(“您的文本”)
我尝试使用AppiumLibrary:AppiumLibrary.Input text//Input[@name=“email”]johndoe@john.doeDid您尝试了sendKey()方法?很抱歉,但该方法在哪个库中?我已经尝试了库SendKeys,但没有成功,它在我的桌面上键入,而不是在虚拟机或模拟器上键入。它是在org.openqa.selenium.remote中定义的。我不知道如何尝试输入文本。您可以尝试sendKey()方法driver.findElementById(“元素id”).sendKey(“您的文本”)
我尝试使用AppiumLibrary:AppiumLibrary.Input text//Input[@name=“email”]johndoe@john.doeDid您尝试了sendKey()方法?很抱歉,但该方法在哪个库中?我已经尝试过库SendKeys,但没有成功,它在我的桌面上键入,而不是在虚拟机或模拟器上键入。它是在org.openqa.selenium.remote中定义的
*** Settings ***
Library Dialogs
Library AppiumLibrary
*** Variables ***
${defaultTimeout} 15s
*** Test Cases ***
TC001
[Setup] Configuration
Start Test
Wait Until Page Contains Element //*[@id='age-gate-yes'] ${defaultTimeout}
Click Element //a[@id='age-gate-yes']
Wait Until Page Contains Element //a[@href="/profile"] ${defaultTimeout}
Click Element //a[@href="/profile"]
Wait Until Page Contains Element //input[@name="email"] ${defaultTimeout}
Click Element //input[@name="email"]
Input Text //input[@name="email"] johndoe@john.doe
Click Element //input[@name="password"]
Input Text //input[@name="password"] JohnDoe123
Click Element //div[@id='react-component-login-header']//button/div/span[1]
Wait Until Page Does Not Contain Element //div[@id='react-component-login-header']//button/div/span[1] ${defaultTimeout}
[Teardown] End Test