Monday, December 24, 2018

Android SDK Command Line Configuration & Emulator Creation

This post contains the details about Android SDK configuration using command line tool. Using this you can avoid to install huge Android Studio setup to create android emulator.

Android SDK on Windows
-------------------------------------------------------------------------------------------------------------
1) Download Android SDK command line toos (sdk-tools-windows-4333796.zip) from the site (https://developer.android.com/studio/index.html)
2) Extracted the zip file
3) Create a directory “android-sdk” in any drive (ex -  C:\Applications\android-sdk)
4) Copy the extracted “tools” directory under the created directory (C:\Applications\android-sdk)

5) Open Command prompt and navigate to android sdk tools\bin directory (D:\Applications\android-sdk\tools\bin). 
                        Execute the command  – sdkmanager --update

6) Run the command - sdkmanager --install platform-tools


7) Now set the path of Android SDK

Update PATH variable, append platform-tools and tools folder – %ANDROID_HOME%\platforms,  %ANDROID_HOME%\platform-tools, %ANDROID_HOME%\tools\bin so that you can run the android command everywhere
Launch the command prompt and run the command to verify the correct path - adb devices


8) Launch the command prompt again and navigate to the directory “D:\Applications\android-sdk\tools\bin”
9) Run the below commands –
                sdkmanager --install "build-tools;28.0.3"
    sdkmanager --install "platforms;android-28"
    sdkmanager --install "system-images;android-28;google_apis;x86"
    sdkmanager --install "system-images;android-28;google_apis_playstore;x86"
    sdkmanager --install "system-images;android-28;google_apis_playstore;x86_64"
    sdkmanager --install "system-images;android-28;google_apis;x86_64"
    sdkmanager --install "extras;google;google_play_services"
    sdkmanage --install "add-ons;addon-google_apis-google-28"
                    sdkmanager --install "extras;intel;Hardware_Accelerated_Execution_Manager"



Note - Go to the ANDROID_HOME\extras\intel\Hardware_Accelerated_Execution_Manager directory, double click on intelhaxm-android.exe and complete the installation.
10) Once complete the above step, exit from the command prompt.
11) Installation completes.

Android SDK on Mac
------------------------------------------------------------------------------------------------
1) Download Android SDK command line toos (sdk-tools-darwin-4333796.zip) from the site (https://developer.android.com/studio/index.html)
2) Create a directory “android-sdk” under /Applications directory
3) Extracted the above download zip under the directory “/Applications/android-sdk” directory
4) Launch terminal and navigate to the directory “/Applications/android-sdk/tools/bin”
5) Run the command - ./sdkmanager --update

6) Run the command - ./sdkmanager --install platform-tools




7) Once complete the above step, exit from the current terminal.

8) Now set the path of Android SDK. Go to terminal and run the command –
                              sudo nano ~/.bash_profile
9) Copy and paste the below line (Make sure about the Android Installation directory)
       export ANDROID_SDK=/Applications/android-sdk
       export ANDROID_HOME=/Applications/android-sdk
       export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin

Save the file using Ctrl+X then Yes and quit the terminal.10) Launch the terminal again and navigate to the directory “/Applications/android-sdk/tools/bin”
11) Run the below commands
            ./sdkmanager --install "build-tools;28.0.3"
            ./sdkmanager --install "platforms;android-28"
            ./sdkmanager --install "system-images;android-28;google_apis;x86"
            ./sdkmanager --install "system-images;android-28;google_apis_playstore;x86"
            ./sdkmanager --install "system-images;android-28;google_apis_playstore;x86_64"

            ./sdkmanager --install "system-images;android-28;google_apis;x86_64"
            ./sdkmanager --install "extras;google;google_play_services"
            ./sdkmanager --install "extras;intel;Hardware_Accelerated_Execution_Manager"







Note - Go to the ANDROID_HOME/extras/intel/Hardware_Accelerated_Execution_Manager directory, double click on intelHAXM_xxx.dmg and complete the installation.
12) Installation completes

Create Android Emulator
---------------------------------------------------------------------------------------------------------------
1) Launch the terminal
2) Execute the command to create an emulator –
avdmanager  -v create avd --name testemulator --package system-images;android-28;google_apis_playstore;x86_64
Press ‘Enter’ against “profile? [no]

3) Launch the terminal. Navigate to the path ANDROID_HOME/tools
4) Launch the emulator using the command and verify its launch successfully–
emulator -avd testemulator

5) Emulator launch successfully

Saturday, December 22, 2018

Eclipse Configuration (with TestNG & Cucumber)

This post contains the details about Eclipse configuration on Windows/Mac system along with plugins like - 

  • Eclipse with TestNG
  • Eclipse with Cucumber
  • Eclipse with PyDev

Eclipse configuration on Windows/Mac
--------------------------------------------------------------------------------------------------------------------
Pre-requisites –
----------------------------------------------------------------------------------------------------------------------
Java should install on the system and JAVA_HOME path should be set.
--------------------------------------------------------------------------------------------------------------------

1) Download Eclipse installer (eclipse-inst-win64.dmg for Mac or eclipse-inst-win64.exe for Windows)
2) On Mac, extract the installer and double click on "Eclipse Installer" and Windows, double click on exe

3) Click on "Eclipse IDE for Java Developers"

4) Set the path and click on Install button

5) Installation completes and shows below screen

6) Click on Launch button to launch the Eclipse

7) Set the Workspace and click on Ok button



TestNG Plug-in In Eclipse
--------------------------------------------------------------------------------------------------------------------
1) Launch the Eclipse IDE and from Help menu, click “Install New Software”

2) Click on Add button

3) Enter name “TestNG” and type “http://dl.bintray.com/testng-team/testng-eclipse-release/” as location. Click OK

4) Select the “TestNG” and click on Next button

5) Complete the installation
6) Restart the Eclipse

Cucumber Plug-in In Eclipse
--------------------------------------------------------------------------------------------------------------------
1) Launch the Eclipse IDE and from Help menu, click “Install New Software”

2) Click on Add button

3) Enter name “Cucumber” and type “http://cucumber.github.com/cucumber-eclipse/update-site” as location. Click OK

4) Select the “Cucumber Eclipse Plugin” and click on Next button

5) Complete the installation
6) Restart the Eclipse

PyDev Plug-in In Eclipse
-------------------------------------------------------------------------------------------------------------------
1) Launch the Eclipse IDE and from Help menu, click “Install New Software”

2) Click on Add button

3) Enter name “PyDev” and type “http://pydev.org/updates” as location. Click OK

4) Select the “PyDev” and click on Next button

5) Complete the installation
6) Restart the Eclipse

Tools Setup on Mac System

This post contains the setup details of tools installation on Mac which require at the time of automation (Web, Mobile or API) configuration. This post covers following tools -
  • Java Installation
  • HomeBrew Installation
  • Maven Installation
  • Ant Installation
  • Node Installation
  • Appium Server Installation
  • Few more.....

Java Installation
-----------------------------------------------------------------------------------------------
1) Download Java installer (latest dmg file) from the site (https://www.oracle.com/technetwork/java/javase/downloads/index.html).
2) Double click on the dmg file. Get the below screen 

3) Double click on the pkg icon

4) Click on the Continue button

5) Click on the Install button and complete the installation


6) Click on Close button

7) Now set the path of JAVA_HOME in ~/.bash_profile file

8) Verify the installation


HomeBrew Installation
-------------------------------------------------------------------------------------------------------
1) Java should install on the system and JAVA_HOME path should be set
2) Open the terminal and execute below command - 
 ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"



Maven Installation
-------------------------------------------------------------------------------------------------------
1) Java should install on the system and JAVA_HOME path should be set.
2) HomeBrew should install on the system. See “HomeBrew Installation” section for more details
3) Open terminal and execute below command - brew install maven

4) Verify the installation


Ant Installation
---------------------------------------------------------------------------------------------------------
1) Java should install on the system and JAVA_HOME path should be set.
2) HomeBrew should install on the system. See “HomeBrew Installation” section for more details
3) Open terminal and execute below command - brew install ant

4)Verify the installation


Node Installation
--------------------------------------------------------------------------------------------------------
1) Java should install on the system and JAVA_HOME path should be set.
2) HomeBrew should install on the system. See “HomeBrew Installation” section for more details
3) Open terminal and execute below command - brew install node

4) Verify the installation


Appium Server Installation
--------------------------------------------------------------------------------------------------------
      1) Node should install on the system. See “Node Installation” section for more details
2) Open terminal and execute below command - npm install -g appium

3) Appium installation starts
4) Verify the installation



Few More Mac Specific tools
--------------------------------------------------------------------------------------------------------
Pre-requisites –
------------------------------------------------------------------------------------------------------
Java should install on the system and JAVA_HOME path should be set.
HomeBrew should install on the system. See the section “HomeBrew Installation” for more details
--------------------------------------------------------------------------------------------------------
1) Install MongoDB Comminity Edition
1.a Execute the command – brew tap mongodb/brew

1.b Execute the command -  brew install mongodb-community@4.2

2) Install ideviceinstaller (Command – brew install ideviceinstaller)

3) Install ios_webkit_debug_proxy  (Command – brew install ios-webkit-debug-proxy)

4) Ios-deploy installation (Command – brew install ios-deploy)

5) Carthage installation (Command - brew install carthage)

6) Install libimobiledevice (Command - brew install libimobiledevice)