follow me icons

Sunday, February 24, 2019

MAC - could not find aapt Please set the ANDROID_HOME environment variable with the Android SDK Root directory path


An unknown server-side error occurred while processing the command. Original error: Could not find aapt Please set the ANDROID_HOME environment variable with the Android SDK root directory path. (Selenium::WebDriver::Error::UnknownError)
  UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not find aapt Please set the ANDROID_HOME environment variable with the Android SDK root directory path.
      at getResponseForW3CError (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/lib/protocol/errors.js:826:9)
      at asyncHandler (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/lib/protocol/protocol.js:447:37)
      at process._tickCallback (internal/process/next_tick.js:68:7)
  ./features/support/hooks.rb:2:in `Before'


To fix the issue:

export ANDROID_HOME="/Users/Users_name/Library/Android/sdk/"



Appium - stack level too deep (SystemStackError)


stack level too deep (SystemStackError)
      ./features/step_definitions/Appium/appiumtest.rb:6:in 
      appium/features/regression/appiumtest.feature:5:in 


The error is caused because the system tries to find the element, but the it is not connected with the emulator and the appium server.

To solve that add a hooks.rb file under the support directory to start and end the driver when the test runs:

hooks.rb:

Before do
  $driver.start_driver 
end

After do
  $driver.driver_quit 
end

Monday, January 21, 2019

Nokogiri ERROR failed to build GEM native extension on MAC OSX




Fetching nokogiri 1.8.5
Installing nokogiri 1.8.5 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/qablog/cucumber/vendor/ruby/2.3.0/gems/nokogiri-1.8.5/ext/nokogiri
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20190121-32936-i6yrat.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /Users/qablog/cucumber/vendor/ruby/2.3.0/gems/nokogiri-1.8.5 for inspection.
Results logged to /Users/qablog/cucumbe/vendor/ruby/2.3.0/extensions/universal-darwin-18/2.3.0/nokogiri-1.8.5/gem_make.out

An error occurred while installing nokogiri (1.8.5), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.8.5' --source 'http://rubygems.org/'` succeeds before bundling.

In Gemfile:
  capybara was resolved to 3.12.0, which depends on
    xpath was resolved to 3.2.0, which depends on
      nokogiri


Solution: Install xcode command line developer tools
sudo xcode-select --install
Password:
xcode-select: note: install requested for command line developer tools

Fetching nokogiri 1.8.5
Installing nokogiri 1.8.5 with native extensions
Fetching rack 2.0.6
Installing rack 2.0.6
Fetching rack-test 1.1.0
Installing rack-test 1.1.0
Fetching regexp_parser 1.3.0
Installing regexp_parser 1.3.0
Fetching xpath 3.2.0
Installing xpath 3.2.0
Fetching capybara 3.12.0
Installing capybara 3.12.0
Fetching ffi 1.9.25
Installing ffi 1.9.25 with native extensions
Fetching childprocess 0.9.0
Installing childprocess 0.9.0
Fetching cucumber-tag_expressions 1.1.1
Installing cucumber-tag_expressions 1.1.1
Fetching gherkin 5.1.0
Installing gherkin 5.1.0
Fetching cucumber-core 3.2.1
Installing cucumber-core 3.2.1
Fetching cucumber-expressions 6.0.1
Installing cucumber-expressions 6.0.1
Fetching cucumber-wire 0.0.1
Installing cucumber-wire 0.0.1
Fetching diff-lcs 1.3
Installing diff-lcs 1.3
Fetching multi_json 1.13.1
Installing multi_json 1.13.1
Fetching multi_test 0.1.2
Installing multi_test 0.1.2
Fetching cucumber 3.1.2
Installing cucumber 3.1.2
Fetching rubyzip 1.2.2
Installing rubyzip 1.2.2
Fetching roo 2.7.1
Installing roo 2.7.1
Fetching rspec-support 3.8.0
Installing rspec-support 3.8.0
Fetching rspec-core 3.8.0
Installing rspec-core 3.8.0
Fetching rspec-expectations 3.8.2
Installing rspec-expectations 3.8.2
Fetching rspec-mocks 3.8.0
Installing rspec-mocks 3.8.0
Fetching rspec 3.8.0
Installing rspec 3.8.0
Fetching rspec-retry 0.6.1
Installing rspec-retry 0.6.1
Fetching selenium-webdriver 3.141.0
Installing selenium-webdriver 3.141.0
Bundle complete! 7 Gemfile dependencies, 34 gems now installed.
Bundled gems are installed into `./vendor`

Wednesday, September 14, 2016

Remove RVM on OSX and switch to RBENV


$ rvm implode
Psychologist intervened, cancelling implosion, crisis avoided :)

$ rvm implode --force
Are you SURE you wish for rvm to implode?
$ This will recursively remove /home/local/.rvm and other rvm traces? yes

Exit and reopen the terminal