java app没有页面_java selenium启动app后,在登录页面定位不到元素。resource-id没错...

在使用Java和Appium进行自动化测试时,遇到了NoSuchElementException异常,无法在启动的APP登录页面定位到指定的元素。错误信息表明元素未在页面上找到,尽管提供了正确的resource-id。检查了环境配置,包括Appium版本、设备信息和平台版本,但问题依然存在。可能的原因包括元素加载时机问题、页面结构变化或Appium设置不正确。
摘要由CSDN通过智能技术生成

Exception in thread "main"org.openqa.selenium.NoSuchElementException: An element could not be located on the page using the given search parameters. (WARNING: The server did not provide any stacktrace information)

Command duration or timeout:0milliseconds

For documentation onthis error, please visit: http://seleniumhq.org/exceptions/no_such_element.html

Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z'System info: host:'2011-20180118QN', ip: '192.168.11.54', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_151'Driver info: io.appium.java_client.android.AndroidDriver

Capabilities {app: D:\Development\workspace\Ap..., appActivity: com.immvp.werewolf.ui.activ..., appPackage: com.immvp.werewolf, browserName: Android, databaseEnabled:false, desired: {app: D:\Development\workspace\Ap..., appActivity: com.immvp.werewolf.ui.activ..., appPackage: com.immvp.werewolf, deviceName: MI 4L TE, noReset: true, noSign: true, platformName: Android, platformVersion: 6.0.1, resetKeyboard: true, unicodeKeyboard: true, uuid: 246c5318}, deviceName: 246c5318, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, noReset: true, noSign: true, platform: LINUX, platformName: LINUX, platformVersion: 6.0.1, resetKeyboard: true, takesScreenshot: true, unicodeKeyboard: true, uuid: 246c5318, warnings: {}, webStorageEnabled: false}

Session ID: 6a356cc9-26e1-43fd-b3d0-302adf2fbd56*** Element info: {Using=id, value=com.immvp.werewolf:id/btnRight}

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)

at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)

at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:40)

at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:80)

at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:44)

at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)

at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:89)

at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)

at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)

at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)

at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)

at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:371)

at io.appium.java_client.DefaultGenericMobileDriver.findElement(DefaultGenericMobileDriver.java:62)

at io.appium.java_client.AppiumDriver.findElement(AppiumDriver.java:1)

at io.appium.java_client.android.AndroidDriver.findElement(AndroidDriver.java:1)

at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:417)

at io.appium.java_client.DefaultGenericMobileDriver.findElementById(DefaultGenericMobileDriver.java:70)

at io.appium.java_client.AppiumDriver.findElementById(AppiumDriver.java:1)

at io.appium.java_client.android.AndroidDriver.findElementById(AndroidDriver.java:1)

at com.dsdj.test.AppiumDemo.main(AppiumDemo.java:65)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值