У меня в проекте есть следующий код:
features / env.rb
require 'rubygems'
require 'rspec'
require 'watir'
require 'webdrivers'
require 'yaml'
require 'fileutils'
require './features/Util/Tools.rb'
require 'json'
require 'watir-scroll'
require "mini_magick"
require 'watir-screenshot-stitch'
require 'appium_lib'
require 'selenium-webdriver'
server_url = 'http://localhost:4723/wd/hub/'
capabilities =
{
platformName: 'Android',
platformVersion: '7.0',
deviceName: 'Android Emulator',
browserName: 'Chrome'
}
$navegador = "chrome_dev_mobile"
$appium_driver = Selenium::WebDriver.for(:remote, :desired_capabilities => capabilities, :url => server_url)
$driver Watir::Browser.new $appium_driver
, когда я запускаю функцию огурца, я получаю эту ошибку:
And Verificar Portal abierto # features/step_definitions/Home/Home_Chile/SD1_Home.rb:16
An unknown server-side error occurred while processing the command. Original error: unknown error: Argument to isShown must be of type Element
(Session info: chrome=69.0.3497.100)
(Driver info: chromedriver=2.42.591059 (a3d9684d10d61aa0c45f6723b327283be1ebaad8),platform=Mac OS X 10.13.6 x86_64) (Selenium::WebDriver::Error::UnknownError)
UnknownError: An unknown server-side error occurred while processing the command. Original error: unknown error: Argument to isShown must be of type Element
(Session info: chrome=69.0.3497.100)
(Driver info: chromedriver=2.42.591059 (a3d9684d10d61aa0c45f6723b327283be1ebaad8),platform=Mac OS X 10.13.6 x86_64)
at errorFromMJSONWPStatusCode (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:789:10)
at ProxyRequestError.getActualError (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:683:14)
at asyncHandler$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:400:25)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/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/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at <anonymous>
./features/pages/Home/Home_Page/P1_HomePage.rb:20:in `verificar_pagina'
./features/step_definitions/Home/Home_Chile/SD1_Home.rb:17:in `"Verificar Portal abierto"'
features/features/Pruebas_Mobile/CL_Mobile.feature:4:in `And Verificar Portal abierto'
Это код внутри ./features/pages/Home/Home_Page/P1_HomePage.rb:20
def verificar_pagina
@caja_busqueda.wait_until_present
if @caja_busqueda.present?
puts "Portal abierto satisfactoriamente con: " + $navegador
end
end
Мобильный Chrome открывает мой URL, а затем появляется эта ошибка.Пожалуйста, я пробую все, я принимаю предложения
Я установил путь к хроматическому драйверу appium вручную и правильно его использую.Видя журнал приложения, показывает следующее с более подробной информацией:
[JSONWP Proxy] Got response with status 200: {"sessionId":"d8b3f057fdc1e6e20a0007f9ed920514","status":13,"value":{"message":"unknown error: Argument to isShown must be of type Element\n (Session info: chrome=69.0.3497.100)\n (Driver info: chromedriver=2.43.600229 (3fae4d0cda5334b4f533bede5a4787f7b832d052),platform=Mac OS X 10.13.6 x86_64)"}}
[W3C] Encountered internal error running command: ProxyRequestError: Could not proxy command to remote server. Original error: The request to /wd/hub/session/3345408e-82f9-4f63-b6ec-f82998806f47/execute has failed
[W3C] at JWProxy.proxy$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:182:13)
[W3C] at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[W3C] at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[W3C] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[W3C] at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[W3C] at
[MJSONWP] Matched JSONWP error code 13 to UnknownError
[HTTP] <-- POST /wd/hub/session/3345408e-82f9-4f63-b6ec-f82998806f47/execute/sync 500 110 ms - 1894
[HTTP]