Install Environment on Windows


Table of contents

  1. General
    1. Chocolatey
    2. Java
      1. JDK
      2. Java Home
    3. Git
    4. IntelliJ IDEA
    5. NodeJS
    6. Allure Commandline
    7. GitHub Desktop
  2. Advance
    1. Android Studio
      1. IDE
      2. SDK
      3. Emulator
      4. Android Home
    2. Appium
      1. Server
      2. Driver
      3. Plugin
      4. Inspector

πŸ”² β†’ Optional
βœ… β†’ Required
πŸ”˜ β†’ Pick One
ℹ️ β†’ Information


General


Chocolatey


https://ngoanh2n.github.io/blog/env/chocolatey

βœ… Installation

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

βœ… Allow Confirmation

choco feature enable --name allowGlobalConfirmation

Open Windows PowerShell with administrator privileges


πŸ”² Validation

choco --version

ℹ️ Location

C:\ProgramData\chocolatey

Java


JDK

https://ngoanh2n.github.io/blog/env/java#windows-jdk

βœ… Installation

πŸ”˜ Eclipse Temurin

choco install temurin21

πŸ”˜ Amazon Corretto

choco install corretto21jdk

Open Command Prompt with administrator privileges

Java Home

https://ngoanh2n.github.io/blog/env/java#windows-java-home

βœ… Setting

setx /m JAVA_HOME "{LOCATION}" & refreshenv
setx /m PATH "%PATH%;%JAVA_HOME%\bin" & refreshenv

β˜‘ Open Command Prompt with administrator privileges
β˜‘ Replace {LOCATION} by your installation directory


πŸ”² Validation

echo %JAVA_HOME%
java --version

ℹ️ Location

πŸ”˜ Eclipse Temurin

C:\Program Files\Eclipse Adoptium\jdk-XX-hotspot

πŸ”˜ Amazon Corretto

C:\Program Files\Amazon Corretto\jdkXX

Git


https://ngoanh2n.github.io/blog/env/git

βœ… Installation

choco install git

Open Command Prompt with administrator privileges


πŸ”² Validation

git --version

IntelliJ IDEA


https://ngoanh2n.github.io/blog/env/intellij-idea

βœ… Installation

πŸ”˜ Chocolatey

choco install intellijidea-community

Open Command Prompt with administrator privileges

πŸ”˜ Setup Wizard

  1. Visit https://www.jetbrains.com/idea/download/?section=windows
  2. Click Download at IntelliJ IDEA Community Edition section
  3. Open ideaIC-XXX.X.X.exe in Downloads
  4. Do installation procedures of Setup Wizard

NodeJS


https://ngoanh2n.github.io/blog/env/nodejs#windows

πŸ”² Installation

πŸ”˜ Chocolatey

choco install nodejs-lts

βœ… Path Setting

setx /m PATH "%PATH%;C:\Program Files\nodejs" & refreshenv
setx /m PATH "%PATH%;C:\{USER}\AppData\Roaming\npm" & refreshenv

β˜‘ Open Command Prompt with administrator privileges
β˜‘ Replace {USER} by your current username

πŸ”˜ Setup Wizard

  1. Visit https://nodejs.org/en/download
  2. Click Windows Installer
  3. Open the node-v20.xx.x-xxx.msi in Downloads
  4. Do installation procedures of Setup Wizard

πŸ”² Validation

node --version
npm --version

ℹ️ Location

C:\Program Files\nodejs
C:\Program Files\nodejs\node_modules\npm

NPM Packages

C:\{USER}\AppData\Roaming\npm

Allure Commandline


https://ngoanh2n.github.io/blog/env/allure-commandline

πŸ”² Installation

npm install --global allure-commandline

πŸ”² Validation

allure --version

ℹ️ Location

C:\Users\{USER}\AppData\Roaming\npm\node_modules\allure-commandline

GitHub Desktop


https://ngoanh2n.github.io/blog/env/github-desktop

πŸ”² Installation

πŸ”˜ Chocolatey

choco install github-desktop

Open Command Prompt with administrator privileges

πŸ”˜ Setup Wizard

  1. Visit https://desktop.github.com
  2. Click Download for Windows
  3. Open GitHubDesktopSetup-xxx.exe in Downloads
  4. Do installation procedures of Setup Wizard

Advance


Android Studio


IDE

https://ngoanh2n.github.io/blog/env/android-studio#ide-windows

βœ… Installation

πŸ”˜ Chocolatey

choco install androidstudio

Open Command Prompt with administrator privileges

πŸ”˜ Setup Wizard

  1. Visit https://developer.android.com/studio
  2. Click Download Android Studio Xxx
  3. Check I have read and agree with the above terms and conditions
  4. Click Download Android Studio Xxx | xxxx.x.x for Windows
  5. Open android-studio-xxx.x.x-windows.exe in Downloads
  6. Do installation procedures of Setup Wizard

SDK

https://ngoanh2n.github.io/blog/env/android-studio#sdk

βœ… Installation

πŸ”˜ Setup Wizard

When opening for the first time after installed Android Studio.

  1. Open Android Studio
  2. Welcome > Next
  3. Install Type > Next
  4. Verify Settings > Next
  5. License Agreement > Accept licenses > Finish
  6. Downloading Components > Finish

πŸ”˜ Download

When missing Android SDK Components. That means, you have NOT installed environment yet as above.

βœ… SDK Manager

  1. Open Android Studio
  2. Open Settings
    Navigation route: More Actions > SDK Manager

βœ… Settings

βœ… SDK Platforms

β˜‘ Show Package Details
β˜‘ Android XX.X
Β Β Β  β˜‘ Android SDK Platform XX
Β Β Β  β˜‘ Sources for Android XX

βœ… SDK Tools

β˜‘ Show Package Details
β˜‘ Android SDK Build-Tools XX
Β Β Β  β˜‘ XX.0.0
β˜‘ Android Emulator
β˜‘ Android SDK Platform-Tools

Emulator

https://ngoanh2n.github.io/blog/env/android-studio#sdk

βœ… Creating

βœ… Virtual Device Manager

  1. Open Android Studio
  2. Open Device Manager
    Navigation route: More Actions > Virtual Device Manager

βœ… Virtual Device Configuration

  1. Create Virtual Device
  2. Select Device > Next
  3. Download System Image: Click Download icon
  4. Agree License: Accept > Next
  5. Complete Requested Actions: Finish
  6. Select System Image > Next
  7. Verify Configuration > Finish
  8. Verify Virtual Devices

Android Home

https://ngoanh2n.github.io/blog/env/android-studio#android-home-windows

βœ… Setting

By default, SDK location is C:\Users\{USER}\AppData\Local\sdk.
The environment variables that need to be set in the following:

  • ANDROID_HOME
  • Tools:
    • Platform Tools: adb
    • Build Tools: apksigner
    • Command-Line Tools: avdmanager, sdkmanager, apkanalyzer
    • Emulator: emulator, mksdcard
setx /m ANDROID_HOME "C:\Users\{USER}\AppData\Local\sdk" & refreshenv
setx /m PATH "%PATH%;%ANDROID_HOME%\platform-tools" & refreshenv
setx /m PATH "%PATH%;%ANDROID_HOME%\build-tools\{API_LEVEL}" & refreshenv
setx /m PATH "%PATH%;%ANDROID_HOME%\cmdline-tools\{CMD_TOOLS_VERSION}\bin" & refreshenv
setx /m PATH "%PATH%;%ANDROID_HOME%\emulator" & refreshenv

β˜‘ Open Command Prompt with administrator privileges
β˜‘ Replace {USER} by your current username
β˜‘ Replace {API_LEVEL} (E.g. 34.0.0)
β˜‘ Replace {CMD_TOOLS_VERSION} (E.g. 13.0)


πŸ”² Validation

echo %ANDROID_HOME%
adb --version

Appium


Server

https://ngoanh2n.github.io/blog/env/appium#server

βœ… Installation

npm install --global appium

πŸ”² Validation

appium --version

ℹ️ Location

C:\Users\{USER}\AppData\Roaming\npm\node_modules\appium

Driver

https://ngoanh2n.github.io/blog/env/appium#driver-windows

βœ… Installation

Suppose I want to setup environment on Windows machine for testing Android app and Windows app.

  1. Android app
    appium driver install uiautomator2
    
  2. Windows app
    appium driver install --source=npm appium-windows-driver
    

Or refer to the Appium Ecosystem’s Drivers for installing appropriate drivers to your testing environment.


πŸ”² Validation

appium driver list --installed

πŸ”² Doctor

appium driver doctor uiautomator2
appium driver doctor windows

ℹ️ Location

C:\Users\{USER}\.appium\node_modules\appium-uiautomator2-driver
C:\Users\{USER}\.appium\node_modules\appium-windows-driver

Plugin

https://ngoanh2n.github.io/blog/env/appium#plugin

πŸ”² Installation

πŸ”² Images

Plugin for image comparison and finding elements by image.

appium plugin install images

Usage

The plugin must be explicitly activated when launching the Appium server.

appium --use-plugins=images

πŸ”² Validation

appium plugin list --installed

ℹ️ Location

C:\Users\{USER}\.appium\node_modules\@appium\images-plugin

Inspector

https://ngoanh2n.github.io/blog/env/appium#inspector

βœ… Installation

Appium Inspector is released in two formats:

πŸ”˜ Desktop application

  1. Visit https://github.com/appium/appium-inspector/releases
  2. Click Appium-Inspector-windows-xxxx.x.x-xxx.exe
  3. Open Appium-Inspector-windows-xxxx.x.x-xxx.exe in Downloads
  4. Do installation procedures of Setup Wizard

πŸ”˜ Web application

Appium Inspector is hosted by Appium Pro. You can inspect your app on this site directly at https://inspector.appiumpro.com.