机器人框架使用appium测试移动应用程序,无法登录应用程序仍然显示错误关键字'AppiumLibrary.Input Text'需要2个参数

问题描述 投票:0回答:1

设置

  • 图书馆 AppiumLibrary

变量

${REMOTE_URL}   http://localhost:4723/wd/hub
${PLATFORM_NAME}    Android
${PLATFORM_VERSION}     10
${DEVICE_NAME}     868101048880709
${PACKAGE_NAME}     com.iremitx.light.remit
${ACTIVITY_NAME}    com.example.love.MainActivity

关键词

Open test application
Open Application    ${REMOTE_URL}
platformName=${PLATFORM_NAME}
platformVersion=${PLATFORM_VERSION}
deviceName=${DEVICE_NAME} 
appPackage=${PACKAGE_NAME}
appActivity=${ACTIVITY_NAME}  

登录应用程序测试

Input Text  xpath://input[@id="0804146915"]
Input Text  xpath://input[@id="123123"]
Click Element  xpath://button[@type="Login]

测试用例

  • TC01 打开 Android 测试应用程序 打开测试申请

  • TC02 登录应用程序 登录应用程序测试

请推荐我在 YouTube 上学习自动化测试的网站、书籍或频道。

android mobile robotframework appium-android
1个回答
0
投票

您应该使用 Appium Inspector 来查找并获取您需要的元素定位器。 定位器的结构与 SeleniumLibrary 中的定位器不同。

这是我的输入元素示例:

AppiumLibrary.Input Text    //android.view.View[@text='Email']/../android.widget.EditText[1]    ${username}

© www.soinside.com 2019 - 2024. All rights reserved.