Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting 'NoMethodError: undefined method `to_sym' for nil:NilClass' error when using Capybara+SitePrism+Appium+Rspec #47

Closed
AlonaPF opened this issue Jun 11, 2019 · 11 comments · Fixed by #48

Comments

@AlonaPF
Copy link

AlonaPF commented Jun 11, 2019

Currently can not run tests that were previously working (10 days ago). When app is installed and invoked it is failing immediately with the error mentioned below on the line '@app.startup.start_button.click`

Environment

  • Mac, rspec 3.8 , capybara 3.18, site_prism 3.2 (versions 3.1 and 3.0 also gave the same error)
  • Rspec as framework

I get the following error:

NoMethodError: undefined method to_sym' for nil:NilClass`

Spec_helper:

    config.before(:example) do |example|
    @app ||= App.new
    @app.startup.start_button.click

Page:

class StartupPage < SitePrism::Page
    element :start_button, :id, 'start'
  end

App.page:

current_path = File.expand_path('..', __FILE__)
$LOAD_PATH.unshift File.join(current_path)

Dir.glob(File.join(current_path, '**', '*.rb')).each do |f|
  require f
end
class App
  def initialize
    @pages = {}
  end
  def startup
    @pages[:startup] ||= StartupPage.new
  end
end
@KazuCocoa
Copy link
Member

If you have Gemfile.lock, could you confirm the diff if it happens on Ruby libraries side?
Sharing your appium log also helpful

@AlonaPF
Copy link
Author

AlonaPF commented Jun 11, 2019

Please take a look at Gemfile.lock
I noticed rubyzip has been changed from 1.2.2 (last working version) to 1.2.3 (what i have now)

  remote: https://rubygems.org/
  specs:
    addressable (2.6.0)
      public_suffix (>= 2.0.2, < 4.0)
    appium_capybara (1.7.0)
      appium_lib (>= 9.15.0)
      capybara (~> 3.0)
    appium_lib (9.17.0)
      appium_lib_core (~> 2.0)
      nokogiri (~> 1.8, >= 1.8.1)
      tomlrb (~> 1.1)
    appium_lib_core (2.3.4)
      faye-websocket (~> 0.10.0)
      selenium-webdriver (~> 3.14, >= 3.14.1)
    capybara (3.18.0)
      addressable
      mini_mime (>= 0.1.3)
      nokogiri (~> 1.8)
      rack (>= 1.6.0)
      rack-test (>= 0.6.3)
      regexp_parser (~> 1.2)
      xpath (~> 3.2)
    childprocess (1.0.1)
      rake (< 13.0)
    diff-lcs (1.3)
    eventmachine (1.2.7)
    faye-websocket (0.10.8)
      eventmachine (>= 0.12.0)
      websocket-driver (>= 0.5.1)
    mini_mime (1.0.1)
    mini_portile2 (2.4.0)
    nokogiri (1.10.3)
      mini_portile2 (~> 2.4.0)
    public_suffix (3.1.0)
    rack (2.0.7)
    rack-test (1.1.0)
      rack (>= 1.0, < 3)
    rake (12.3.2)
    regexp_parser (1.5.1)
    rspec (3.8.0)
      rspec-core (~> 3.8.0)
      rspec-expectations (~> 3.8.0)
      rspec-mocks (~> 3.8.0)
    rspec-core (3.8.0)
      rspec-support (~> 3.8.0)
    rspec-expectations (3.8.4)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.8.0)
    rspec-mocks (3.8.0)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.8.0)
    rspec-support (3.8.2)
    rubyzip (1.2.3)
    selenium-webdriver (3.142.3)
      childprocess (>= 0.5, < 2.0)
      rubyzip (~> 1.2, >= 1.2.2)
    site_prism (3.2)
      addressable (~> 2.5)
      capybara (~> 3.2)
    tomlrb (1.2.8)
    websocket-driver (0.7.1)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.4)
    xpath (3.2.0)
      nokogiri (~> 1.8)

PLATFORMS
  ruby

DEPENDENCIES
  appium_capybara
  appium_lib (= 9.17.0)
  capybara (= 3.18.0)
  rspec (= 3.8.0)
  selenium-webdriver
  site_prism (= 3.2)

BUNDLED WITH
   2.0.1

Here please see Appium log

The server is running
[Appium] Welcome to Appium v1.13.0
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"deviceName":"emulator-5554","platformName":"Android","systemPort":"8200","app":"/Users/alona/Projects/apps/androidApp.apk","autoGrantPermissions":true},"capabilities":{"firstMatch":[{"appium:deviceName":"emulator-5554","platformName":"Android","appium:systemPort":"8200","appium:app":"/Users/alona/Projects/apps/androidApp.apk","appium:autoGrantPermissions":true}]}}
[W3C] Calling AppiumDriver.createSession() with args: [{"deviceName":"emulator-5554","platformName":"Android","systemPort":"8200","app":"/Users/alona/Projects/apps/androidApp.apk","autoGrantPermissions":true},null,{"firstMatch":[{"appium:deviceName":"emulator-5554","platformName":"Android","appium:systemPort":"8200","appium:app":"/Users/alona/Projects/apps/androidApp.apk","appium:autoGrantPermissions":true}]}]
[BaseDriver] Event 'newSessionRequested' logged at 1560260912328 (17:48:32 GMT+0400 (+04))
[Appium] 
[Appium] ======================================================================
[Appium]   DEPRECATION WARNING:
[Appium] 
[Appium]   The 'automationName' capability was not provided in the desired 
[Appium]   capabilities for this Android session
[Appium] 
[Appium]   Setting 'automationName=UiAutomator1' by default and using the 
[Appium]   UiAutomator1 Driver
[Appium] 
[Appium]   The next minor version of Appium (1.14.x) will set 
[Appium]   'automationName=UiAutomator2' by default and use the UiAutomator2 
[Appium]   Driver
[Appium] 
[Appium]   The next major version of Appium (2.x) will **require** the 
[Appium]   'automationName' capability to be set for all sessions on all 
[Appium]   platforms
[Appium] 
[Appium]   If you are happy with 'UiAutomator1' and do not wish to upgrade 
[Appium]   Android drivers, please add 'automationName=UiAutomator1' to your 
[Appium]   desired capabilities
[Appium] 
[Appium]   For more information about drivers, please visit 
[Appium]   http://appium.io/docs/en/about-appium/intro/ and explore the 
[Appium]   'Drivers' menu
[Appium] 
[Appium] ======================================================================
[Appium] 
[Appium] Setting automation to 'UiAutomator1'. 
[Appium] Appium v1.13.0 creating new AndroidDriver (v4.15.1) session
[Appium] Capabilities:
[Appium]   platformName: Android
[Appium]   deviceName: emulator-5554
[Appium]   systemPort: 8200
[Appium]   app: /Users/alona/Projects/apps/androidApp.apk
[Appium]   autoGrantPermissions: true
[BaseDriver] W3C capabilities {"alwaysMatch":{"platformNa... and MJSONWP desired capabilities {"deviceName":"emulator-555... were provided
[BaseDriver] Creating session with W3C capabilities: {"alwaysMatch":{"platformNa...
[BaseDriver] The following capabilities were provided, but are not recognized by appium: systemPort.
[BaseDriver] Session created with session id: a802003e-23de-4679-a7fe-bb46c4b12b2a
[ADB] Using 'adb' from '/Users/alona/Library/Android/sdk/platform-tools/adb'
[AndroidDriver] Retrieving device list
[ADB] Trying to find a connected android device
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[AndroidDriver] Using device: emulator-5554
[ADB] Using 'adb' from '/Users/alona/Library/Android/sdk/platform-tools/adb'
[ADB] Setting device id to emulator-5554
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell getprop ro.build.version.sdk'
[ADB] Current device property 'ro.build.version.sdk': 28
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell getprop ro.build.version.release'
[ADB] Current device property 'ro.build.version.release': 9
[ADB] Device API level: 28
[AndroidDriver] Consider setting 'automationName' capability to 'uiautomator2' on Android >= 6, since UIAutomator framework is not maintained anymore by the OS vendor.
[BaseDriver] Using local app '/Users/alona/Projects/apps/androidApp.apk'
[AndroidDriver] Checking whether app is actually present
[AndroidDriver] Starting Android session
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 wait-for-device'
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell echo ping'
[AndroidDriver] Pushing settings apk to device...
[ADB] Getting install status for io.appium.settings
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings'
[ADB] 'io.appium.settings' is installed
[ADB] Getting package info for 'io.appium.settings'
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings'
[ADB] Using 'aapt' from '/Users/alona/Library/Android/sdk/build-tools/28.0.3/aapt'
[ADB] The version name of the installed 'io.appium.settings' is greater or equal to the application version name ('2.14.0' >= '2.14.0')
[ADB] There is no need to install/upgrade '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/io.appium.settings/apks/settings_apk-debug.apk'
[ADB] Getting IDs of all 'io.appium.settings' processes
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell 'pgrep --help; echo $?''
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell pgrep -f io\\.appium\\.settings'
[AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions.
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell appops set io.appium.settings android\:mock_location allow'
[Logcat] Starting logcat capture
[ADB] Getting device platform version
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell getprop ro.build.version.release'
[ADB] Current device property 'ro.build.version.release': 9
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell wm size'
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell getprop ro.product.model'
[ADB] Current device property 'ro.product.model': Android SDK built for x86
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell getprop ro.product.manufacturer'
[ADB] Current device property 'ro.product.manufacturer': Google
[AndroidDriver] Parsing package and activity from app manifest
[ADB] Using 'apkanalyzer' from '/Users/alona/Library/Android/sdk/tools/bin/apkanalyzer'
[ADB] Starting '/Users/alona/Library/Android/sdk/tools/bin/apkanalyzer' with args ["-h","manifest","print","/Users/alona/Projects/apps/androidApp.apk"]
[ADB] Package name: '<package name'
[ADB] Main activity name: '<package>'
[AndroidDriver] Parsed package and activity are: <package>ui.activity.ConfigurationActivity
[ADB] Getting install status for <package>
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package <package>'
[ADB] <package> is installed
[ADB] Getting install status for <package>
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package <package>
[ADB] <package> is installed
[ADB] Getting package info for <package>
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package <package>
[ADB] The version name of the installed <package> is greater or equal to the application version name ('7.0.2' >= '7.0.2')
[ADB] There is no need to install/upgrade '/Users/alona/Projects/apps/androidApp.apk'
[AndroidDriver] Performing fast reset on <package>
[ADB] Getting install status for <package>
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package <package>
[ADB] <package> is installed
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop <package>
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell pm clear <package>
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package <package>
[ADB] Retrieving requested permissions
[ADB] Retrieved 12 permission(s) from ["requested"] group(s)
[ADB] Retrieving granted permissions
[ADB] Retrieved 8 permission(s) from ["install","runtime"] group(s)
[ADB] Granting permissions ["android.permission.ACCESS_COARSE_LOCATION","android.permission.ACCESS_FINE_LOCATION","android.permission.READ_PHONE_STATE","android.permission.CALL_PHONE"] to <package>
[ADB] Got the following command chunks to execute: [["pm","grant",<package>,"android.permission.ACCESS_COARSE_LOCATION",";","pm","grant","<package>","android.permission.ACCESS_FINE_LOCATION",";","pm","grant","<package>","android.permission.READ_PHONE_STATE",";","pm","grant","<package>","android.permission.CALL_PHONE",";"]]
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell pm grant <package> android.permission.ACCESS_COARSE_LOCATION \; pm grant <package> android.permission.ACCESS_FINE_LOCATION \; pm grant <package>android.permission.READ_PHONE_STATE \; pm grant <package> android.permission.CALL_PHONE \;'
[AndroidDriver] Performed fast reset on the installed '<package>' application (stop and clear)
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell rm -rf /data/local/tmp/strings.json'
[AndroidDriver] Extracting strings from apk
[AndroidDriver] /Users/alona/Projects/apps/androidApp.apk
[AndroidDriver] undefined
[AndroidDriver] /var/folders/87/xm7zwnhx33301c2q442r67ww0000gn/T/<package>
[ADB] Extracting strings from for language: default
[ADB] Successfully extracted 797 strings from '/Users/alona/Projects/apps/androidApp.apk' resources for '(default)' configuration
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell mkdir -p /data/local'
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 push /var/folders/87/xm7zwnhx33301c2q442r67ww0000gn/T/<package>/strings.json /data/local/tmp'
[AndroidBootstrap] Watching for bootstrap disconnect
[ADB] Forwarding system: 4724 to device: 4724
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 forward tcp\:4724 tcp\:4724'
[UiAutomator] Starting UiAutomator
[UiAutomator] Moving to state 'starting'
[UiAutomator] Parsing uiautomator jar
[UiAutomator] Found jar name: 'AppiumBootstrap.jar'
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell mkdir -p /data/local'
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 push /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-android-driver/bootstrap/bin/AppiumBootstrap.jar /data/local/tmp/'
[ADB] Attempting to kill all uiautomator processes
[ADB] Getting IDs of all 'uiautomator' processes
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell pgrep -f uiautomator'
[ADB] No 'uiautomator' process has been found
[UiAutomator] Starting UIAutomator
[ADB] Creating ADB subprocess with args: ["-P",5037,"-s","emulator-5554","shell","uiautomator","runtest","AppiumBootstrap.jar","-c","io.appium.android.bootstrap.Bootstrap","-e","pkg","<package>","-e","disableAndroidWatchers",false,"-e","acceptSslCerts",false]
[UiAutomator] Moving to state 'online'
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] json loading complete.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Registered crash watchers.
[AndroidBootstrap] Android bootstrap socket is now connected
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys window'
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Client connected
[AndroidDriver] Screen already unlocked, doing nothing
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am start -W -n <package>/ui.activity.ConfigurationActivity -S'
[ADB] Waiting up to 20000ms for activity matching pkg: '<package>' and activity: '<package>.ui.activity.ConfigurationActivity' to be focused
[ADB] Possible activities, to be checked: '<package>.ui.activity.ConfigurationActivity', '<package>/ui.activity.ConfigurationActivity'
[ADB] Getting focused package and activity
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys window windows'
[ADB] Found package: '<package>' and fully qualified activity name : '<package>ui.activity.ConfigurationActivity'
[Appium] New AndroidDriver session created successfully, session a802003e-23de-4679-a7fe-bb46c4b12b2a added to master session list
[BaseDriver] Event 'newSessionStarted' logged at 1560260917927 (17:48:37 GMT+0400 (+04))
[W3C (a802003e)] Cached the protocol value 'W3C' for the new session a802003e-23de-4679-a7fe-bb46c4b12b2a
[W3C (a802003e)] Responding to client with driver.createSession() result: {"capabilities":{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","deviceName":"emulator-5554","systemPort":"8200","app":"/Users/alona/Projects/apps/androidApp.apk","autoGrantPermissions":true},"platformName":"Android","deviceName":"emulator-5554","systemPort":"8200","app":"/Users/alona/Projects/apps/androidApp.apk","autoGrantPermissions":true,"deviceUDID":"emulator-5554","platformVersion":"9","deviceScreenSize":"1440x2880","deviceModel":"Android SDK built for x86","deviceManufacturer":"Google","appPackage":"<package>","appWaitPackage":"<package>","appActivity":"<package>.ui.activity.ConfigurationActivity","appWaitActivity":"<package>.ui.activity.ConfigurationActivity"}}
[HTTP] <-- POST /wd/hub/session 200 5603 ms - 1001
[HTTP] 
[HTTP] --> POST /wd/hub/session/a802003e-23de-4679-a7fe-bb46c4b12b2a/timeouts
[HTTP] {"implicit":60000}
[W3C (a802003e)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,60000,"a802003e-23de-4679-a7fe-bb46c4b12b2a"]
[BaseDriver] W3C timeout argument: {"implicit":60000}}
[BaseDriver] Set implicit wait to 60000ms
[W3C (a802003e)] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/a802003e-23de-4679-a7fe-bb46c4b12b2a/timeouts 200 5 ms - 14
[HTTP] 
[HTTP] --> GET /wd/hub/status
[HTTP] {}
[GENERIC] Calling AppiumDriver.getStatus() with args: []
[GENERIC] Responding to client with driver.getStatus() result: {"build":{"version":"1.13.0"}}
[HTTP] <-- GET /wd/hub/status 200 2 ms - 68
[HTTP] 
[HTTP] --> DELETE /wd/hub/session/a802003e-23de-4679-a7fe-bb46c4b12b2a
[HTTP] {}
[W3C (a802003e)] Calling AppiumDriver.deleteSession() with args: ["a802003e-23de-4679-a7fe-bb46c4b12b2a"]
[BaseDriver] Event 'quitSessionRequested' logged at 1560260917952 (17:48:37 GMT+0400 (+04))
[Appium] Removing session a802003e-23de-4679-a7fe-bb46c4b12b2a from our master session list
[AndroidDriver] Shutting down Android driver
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop <package>'
[ADB] Pressing the HOME button
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell input keyevent 3'
[AndroidBootstrap] Sending command to android: {"cmd":"shutdown"}
[AndroidBootstrap] Received command result from bootstrap
[UiAutomator] Shutting down UiAutomator
[UiAutomator] Moving to state 'stopping'
[UiAutomator] UiAutomator shut down normally
[UiAutomator] Moving to state 'stopped'
[ADB] Attempting to kill all uiautomator processes
[ADB] Getting IDs of all 'uiautomator' processes
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell pgrep -f uiautomator'
[ADB] No 'uiautomator' process has been found
[UiAutomator] Moving to state 'stopped'
[Logcat] Stopping logcat capture
[ADB] Running '/Users/alona/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop io.appium.unlock'
[AndroidDriver] Not cleaning generated files. Add `clearSystemFiles` capability if wanted.
[BaseDriver] Event 'quitSessionFinished' logged at 1560260918820 (17:48:38 GMT+0400 (+04))
[W3C (a802003e)] Received response: null
[W3C (a802003e)] But deleting session, so not returning
[W3C (a802003e)] Responding to client with driver.deleteSession() result: null
[HTTP] <-- DELETE /wd/hub/session/a802003e-23de-4679-a7fe-bb46c4b12b2a 200 873 ms - 14
[HTTP] 

@KazuCocoa
Copy link
Member

Thanks.
I would recommend you to set automationName as uiautomator2 as the log says

and could you give me the stacktrace of @app.startup.start_button.click?

BTW, can you run https://github.com/appium/appium_capybara/tree/master/example on your env?
Maybe, the example is almost the same on your environment. If it works, probably your code hasany issues.

@AlonaPF
Copy link
Author

AlonaPF commented Jun 12, 2019

I tried to set automationName as uiautomator2 but it still giving me the same error
stacktrace is :

NoMethodError:
       undefined method `to_sym' for nil:NilClass
     # /Users/alona/.rvm/gems/ruby-2.6.0/gems/appium_lib_core-3.1.2/lib/appium_lib_core/common/base/search_context.rb:163:in `_set_by_from_finders'
     # /Users/alona/.rvm/gems/ruby-2.6.0/gems/appium_lib_core-3.1.2/lib/appium_lib_core/common/base/search_context.rb:150:in `find_elements'
     # /Users/alona/.rvm/gems/ruby-2.6.0/gems/appium_lib-10.3.1/lib/appium_lib/driver.rb:698:in `find_elements'
     # /Users/alona/.rvm/gems/ruby-2.6.0/gems/appium_capybara-1.8.0/lib/appium_capybara/driver/appium/driver.rb:95:in `find_custom'
     # /Users/alona/.rvm/gems/ruby-2.6.0/gems/appium_capybara-1.8.0/lib/appium_capybara/ext/base_ext.rb:3:in `find_custom'
     # /Users/alona/.rvm/gems/ruby-2.6.0/gems/appium_capybara-1.8.0/lib/appium_capybara/ext/selector_query_ext.rb:11:in `block in resolve_for'
     # /Users/alona/.rvm/gems/ruby-2.6.0/gems/capybara-3.23.0/lib/capybara/node/base.rb:77:in `synchronize'
     # /Users/alona/.rvm/gems/ruby-2.6.0/gems/appium_capybara-1.8.0/lib/appium_capybara/ext/selector_query_ext.rb:5:in `resolve_for'
     # /Users/alona/.rvm/gems/ruby-2.6.0/gems/capybara-3.23.0/lib/capybara/node/finders.rb:289:in `block in synced_resolve'
     # /Users/alona/.rvm/gems/ruby-2.6.0/gems/capybara-3.23.0/lib/capybara/node/base.rb:83:in `synchronize'
     # /Users/alona/.rvm/gems/ruby-2.6.0/gems/capybara-3.23.0/lib/capybara/node/finders.rb:287:in `synced_resolve'
     # /Users/alona/.rvm/gems/ruby-2.6.0/gems/capybara-3.23.0/lib/capybara/node/finders.rb:52:in `find'
     # /Users/alona/.rvm/gems/ruby-2.6.0/gems/capybara-3.23.0/lib/capybara/session.rb:749:in `block (2 levels) in<class:Session>'
     # /Users/alona/.rvm/gems/ruby-2.6.0/gems/site_prism-3.2/lib/site_prism/page.rb:107:in `_find'
     # /Users/alona/.rvm/gems/ruby-2.6.0/gems/site_prism-3.2/lib/site_prism/dsl.rb:82:in `block (2 levels) in element'
     # ./spec/spec_helper.rb:74:in `block (2 levels) in <top (required)>'
     # /Users/alona/.rvm/gems/ruby-2.6.0/gems/allure-rspec-0.8.0/lib/allure-rspec/hooks.rb:33:in `run'
     # /Users/alona/.rvm/gems/ruby-2.6.0/gems/allure-rspec-0.8.0/lib/allure-rspec/hooks.rb:33:in `run'

@AlonaPF
Copy link
Author

AlonaPF commented Jun 12, 2019

also i have run the project you sent and i still get the same error

@serhatbolsu
Copy link

(having the same issue) I have debugged deeply, it seems like Test does not use appium driver instead tries Capybara and then cant find the selector (:id).
Also tested without site-prism , it works. (even thought it fails on first query, does not wait for element)
can it be something about initialization of the driver ? that it does not override capybara methods

@KazuCocoa
Copy link
Member

Also tested without site-prism , it works.

mm, interesting...
I'll try to take a look at it...

(even thought it fails on first query, does not wait for element)

Affected https://github.com/appium/ruby_lib/blob/master/CHANGELOG.md#1-enhancements-5 ?
You can set the default value by you.

@AlonaPF
Copy link
Author

AlonaPF commented Jun 13, 2019

@KazuCocoa so i cleaned the gemset that was used and turned out that the problem occurs because of capybara version
So basically capybara 3.18.0 with appium-capybara 1.7.0 was the latest working versions for me
I tried to use capybara 3.19.0 with appium-capybara 1.8.0 - it gave me the error
Same with capybara 3.20.x, 3.21.x and 3.22.x

Could you please take a look at this problem?

@KazuCocoa
Copy link
Member

Confirmed. It looked omething wrong between capybara 3.18.0 and 3.19.0 fix.
(site_prime 3.2 worked with capybara 3.18.0 and appium-capybara 1.7.0)


The diff is teamcapybara/capybara@3.18.0...3.19.0

@KazuCocoa
Copy link
Member

@AlonaPF @serhatbolsu
Hi, could you try the latest master?
I read the code diff. The current master should work fine.
(Example worked with it)

@AlonaPF
Copy link
Author

AlonaPF commented Jul 3, 2019

Worked for me with newest version as of now.
Thanks @KazuCocoa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants