Как инициализировать скрытые объекты страницы, используя appium ruby - PullRequest
0 голосов
/ 16 мая 2018

Я использую объектную модель страницы для мобильного приложения.Я не могу инициализировать элементы, которые скрыты на странице, но будут видны позже в тесте.Может кто-нибудь подсказать, пожалуйста, какое решение для этого?Ниже приведен код и ошибка:

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

...