如何使用appium ruby​​初始化隐藏的页面对象

时间:2018-05-16 19:08:40

标签: ruby selenium appium pageobjects appium-android

我正在使用移动应用的页面对象模型。我无法初始化页面上隐藏的元素,但稍后会在测试中看到。有人可以建议它的解决方案是什么?以下是代码和错误:

class AppDetails
    include PageObject
    attr_reader :appium_driver, :screen, :button, :header, :more_info, :type
 def initialize(driver, package_name)
    @screen = driver.find_element(blaahh)
    @button = driver.find_element(blaahh)
    @more_info = driver.find_element(blaahh) **###hidden element**
    @type = driver.find_element(blaahh) **###hidden element**
 end
end

当我运行自动化时,我收到以下错误:

Selenium::WebDriver::Error::NoSuchElementError: An element could not be located on the page using the given search parameters.
NoSuchElementError: An element could not be located on the page using the given search parameters.
    at AndroidDriver.callee$0$0$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-android-driver/lib/commands/find.js:69:13)
    at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-android-driver/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-android-driver/node_modules/babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-android-driver/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-android-driver/node_modules/babel-runtime/regenerator/runtime.js:136:37)
    at <anonymous>

谢谢, RV

0 个答案:

没有答案