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

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

Update Ruby-Build definition in OSX

$ rbenv install 2.1.3
ruby-build: definition not found: 2.1.3

You can list all available versions with `rbenv install --list'.

If the version you're looking for is not present, first try upgrading
ruby-build. If it's still missing, open a request on the ruby-build

issue tracker: https://github.com/sstephenson/ruby-build/issues

$ sudo brew uninstall ruby-build
Uninstalling /usr/local/Cellar/ruby-build/20140702...


$ sudo brew install --HEAD ruby-build
==> Cloning https://github.com/sstephenson/ruby-build.git
Cloning into '/Library/Caches/Homebrew/ruby-build--git'...
remote: Counting objects: 343, done.
remote: Compressing objects: 100% (276/276), done.
remote: Total 343 (delta 147), reused 154 (delta 63), pack-reused 0
Receiving objects: 100% (343/343), 88.76 KiB | 126.00 KiB/s, done.
Resolving deltas: 100% (147/147), done.
Checking connectivity... done.
==> ./install.sh


$ rbenv install 2.1.3
Downloading ruby-2.1.3.tar.bz2...

-> https://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.3.tar.bz2