Sunday, September 22, 2019

Quality Assurance - Must Know

Quality Assurance Team plays a critical role in testing and validating the software.
Manual Testing of software is relatively easy but the understanding of processes keeps you distant apart from a regular engineer.

Testing of applications can be done, either through,
i. Manual Testing
ii. Automation Testing

Types of Applications, 
i. Native Application
ii. Web Application
iii. Hybrid Application

Platforms where applications are typically launched
i. Android devices, includes TV, phones, Tabs and any custom devices
ii. iOS devices, includes TV, phones, Tabs and any custom devices
iii. Smart TV
iv. Browsers like Safari, Chrome, IE, Firefox
v. Set Top Boxes
vi. Native Infotainment Systems


All about Android Applications
Android in current times hold 80% of market share and testing of android applications is a very crucial and opens a door with vast set of opportunity

Important Pointers while testing Android application.

1. adb setup and installation for Android devices
Communication with devices can happen through adb commands. adb is included in the Android SDK Platform-Tools package. The package with the SDK Manager can be downloaded from 
https://developer.android.com/studio/releases/platform-tools
Download the zip file and extract it in a folder typically in c:\adb\

Environment variable setup for windows
Open the Start menu and search “advanced system settings”
Click “View advanced system settings”
Click “Environment Variables”
Under “System variables” click “Path”
Click “Edit...”
(Windows 10): Click “New” and paste the folder path where Platform Tools are extracted. Press the OK button.
(Windows 7 and 8): Add ;[FOLDERNAME] to the end of the “Variable value” box, replacing [FOLDERNAME] with folder path where Platform Tools are kept. Add semicolon at the beginning so Windows knows you’re adding a new folder.

Now open command prompt and type adb and hit enter. The response should be a list of supported adb commands. If any errors related to command not found, try the following,
i. Restart the system
ii. Confirm the environment variable is set properly with correct path

2. Connection with Android Devices through adb

To use adb with a device connected over USB, enable USB debugging in the device system settings, under Developer options.
On Android 4.2 and higher, the Developer options screen is hidden by default. 
To make it visible, go to Settings > About phone and tap Build number five to seven times. 
Return to the previous screen and search for Developer options.
On some devices, the Developer options screen might be located or named differently, please check from manufacturers specific to Vendor/model/make

ADB Command to list down all the devices connected to Machine through USB,
adb devices

ADB Connect to a device over Wi-Fi (Android 10 and lower)
adb usually communicates with the device over USB, but you can also use adb over Wi-Fi after some initial setup over USB, as described below. 

Connect the Android device and adb host computer to a common Wi-Fi network accessible to both. Beware that not all access points are suitable; you might need to use an access point whose firewall is configured properly to support adb.
If you are connecting to a Wear OS device, turn off Bluetooth on the phone that's paired with the device.
Connect the device to the host computer with a USB cable.
Set the target device to listen for a TCP/IP connection on port 5555.
adb tcpip 5555

Disconnect the USB cable from the target device.
Find the IP address of the Android device. For example, on a Nexus device, you can find the IP address at Settings > About tablet (or About phone) > Status > IP address. Or, on a Wear OS device, you can find the IP address at Settings > Wi-Fi Settings > Advanced > IP address.
Connect to the device by its IP address.
adb connect device_ip_address

Confirm that your host computer is connected to the target device:
$ adb devices
List of devices attached
device_ip_address:5555 device

Connect to specific device if Multiple devices are connected to the system
Open command prompt and type the command,
adb devices

If the result shows multiple devices and you want to connect to specific device the command is,
adb -s <device id> shell

<device id> can be fetched throughadb devices command.

3. Installation of application
Android app, typically an .apk file can be installed by the following methods,
i. Download & Install through Android Play Store, Marktplace, Alpha and Beta Stores
ii. APK if downloaded through drives or any other third party app centres on devices can be installed through Android Package Installer
iii. APK can be installed using adb commands, 
adb install Testme.apk
If you want to replace the existing application the command is,
adb install -r MyApp.apk
4. Log Collection
Debugging of Android devices can be done through various ways some of it are,
i. Android terminal application that can capture logs 
ii. Using adb commands
To capture android logcat commands,
adb logcat
To capture android logcat commands and save in a file,
adb logcat > abc.txt 
Print the most recent lines since the specified time. 
adb logcat -t '01-26 20:52:41.820'
Flush (clear) the entire log and exit.
adb logcat -c
Only print logs from the given PID.
adb logcat --pid=<pid>