Tuesday, December 22, 2015

GUI(Graphical User Interface) Testing




What is GUI ?
As we know, computer has two types of interfaces!
1. Command Line Interface - on typing text, computer responds to that command.
2. Graphical User Interface(GUI) - To interact with the computer using images rather than text.
Following are the GUI elements which can be used for interaction between the user and application:



Great, now we can proceed in testing GUI. But how? 
Here, is brief explanation of how and what is to be tested in GUI testing.
What is GUI Testing?
It is the process of testing an application GUI of the System Under Test. GUI testing involves checking the screens which has controls like menus, buttons, icons, and all types of bars – tool bar, menu bar, dialog boxes, windows, application fragments etc.
What do you Check in GUI Testing ?
The below are few points will fortify GUI Testing.
  • Verify all the GUI elements for size, position, width, length and characters or numbers accepted.
  • Verify you can execute the intended functionality of an application using GUI elements
  • Verify Error Messages are displayed correctly
  • Verify for Clear demarcation of different sections on screen
  • Verify Font used in application is readable
  • Verify the alignment of the text is proper
  • Verify the Colour of the font and warning messages is aesthetically pleasing
  • Verify that the images have good clarity
  • Verify that the images are properly aligned
  • Verify the positioning of GUI elements for different screen resolution.
GUI testing can be done through three ways:
Manual Based Testing
In manual based testing, graphical screens are checked manually by testers with the requirements stated in requirements document.


Record and Replay
GUI testing can be done using automation tools. This is done in 2 parts. During Record , test steps are captured into the automation tool. During playback, the recorded test steps are executed on the Application Under Test. Example of such tools – QTP .


Model Based Testing
A model is a graphical description of system’s behavior. It helps us to understand and predict the system behavior. Models help in a generation of efficient test cases using the system requirements. Following needs to be considered for this model based testing:
  • Build the model
  • Determine Inputs for the model
  • Calculate expected output for the model
  • Run the tests
  • Compare the actual output with the expected output
  • Decision on further action on the model
Some of the modeling techniques from which test cases can be derived:
  • Charts – Depicts the state of a system and checks the state after some input.
  • Decision Tables – Tables used to determine results for each input applied
Model based testing is an evolving technique for the generating the test cases from the requirements.Its main advantage, compared to above two methods, is that it can determine undesirable states that your GUI can attain.



Few Test Cases for GUI

  1. Testing the size, position, width, height of the elements.
  2. Testing of the error messages that are getting displayed.
  3. Testing the different sections of the screen.
  4. Testing of the font whether it is readable or not.
  5. Testing of the screen in different resolutions with the help of zooming in and zooming out like 640 x 480, 600 x 800, etc.
  6. Testing the alignment of the texts and other elements like icons, buttons, etc. are in proper place or not.
  7. Testing the colors of the fonts.
  8. Testing the colors of the error messages, warning messages.
  9. Testing whether the image has good clarity or not.
  10. Testing the alignment of the images.
  11. Testing of the spelling.
  12. The user must not get frustrated while using the system interface.
  13. Testing whether the interface is attractive or not.
  14. Testing of the scrollbars according to the size of the page if any.
  15. Testing of the disabled fields if any.
  16. Testing of the size of the images.
  17. Testing of the headings whether it is properly aligned or not.
  18. Testing of the color of the hyperlink.

Monday, December 21, 2015

How to install .apk in Android devices

Builds transfer

Builds can be transferred to/from android device to PC/Mac using USB cable or Wi-fi. To transfer files using USB cable, make sure UBS debugging is enabled in device.
Android file transfer for mac
  • Download & install Android File Transfer
  • Plug the device to Mac with a USB cable.
  • Android file transfer window should launch automatically.
  • Drag & drop builds to/from finder to transfer.
Android file transfer in PC:
  • Plug the device to PC using USB cable.
  • Device should be detected as a media device.
  • Open device in explorer & simply copy paste builds.

Build transfer through Wi-fi:

Files can be transferred over Wi-fi using apps from google play store.
Air Droid’ is a convenient one to use. Following are steps to transfer files through Air droid:
  • Install Air Droid from google play store.
  • Open Air Droid.
  • Open browser & enter address http://web.airdroid.com
  • When page opens, enter the code showed in device or scan QR code from the PC/Mac monitor.
  • Device will be connected to PC/Mac. Upload build to device from any location in PC/Mac.
Note: Device & PC/Mac should be in one Wi-fi network.
Install from unknown sources:
  • Before installing build, installation of app from unknown sources should be enabled in device.
  • To do so, enter settings/security.
  • From ‘Device Administration’ section, check on ‘Unknown Sources’.
Install builds from File Manager:
  • Installing build will require any file manager app. This app does not comes with OS bundle.
  • Download & install any free File Manager app from google play store.
  • Browse to the build location from file manager app.
  • Tap on the build.
  • Installation popup appear.
  • Tap ‘Install’ button & proceed.
  • Build is installed in device.

Installing builds from testflight:

  • From the device, open browser & go to https://testflightapp.com/androidsplash.
  • Download Testflight App for android.
  • After download & install, create an account or sign in with existing account to access available build. Note that to get a build, the testflight account should should be invited to the project.
Install builds from Testflight:
  • Launch TestFlight in device.
  • Available builds shows in the app.
  • Tap ‘Install’ button & confirm to install the build

Installing builds from ADB:

– Make sure you have installed Eclipse
– Make sure you have installed ADT plug-in
– Make sure you have installed ADB in your machine
– Make sure you have enabled USB debugging
1. Connect Android device to your Machine
2. Open terminal/command prompt
3. Enter command “adb devices” (to verify device is connected with your machine and remote quotes in command line)
4. Enter command “adb install <file name>” (remove text ‘File’ and run)

Sunday, December 20, 2015

How to Proxying Charles on Android or iOS Devices

Charles Proxy Configuration
Android:
  1. Enter Settings.
  2. Tap on Wi-Fi
  3. Tap & hold on the network you are connected.
  4. Tap Modify network.
  5. Check the Show advanced options.
  6. From Proxy settings dropdown, choose Manual.
  7. Set your system IP as Proxy hostname.
  8. Set a port that you use in charles tool to log (default: 8888).
  9. Save & Start your app.

iOS:
Enter Settings.
Tap on Wi-Fi.
Scroll down to see Proxy settings.
Tap on Http Proxy.
Set your system IP as Proxy hostname.
Set a port that you use in charles tool to log (Default: 8888).

NOTE:
- After starting app, application Charles running in PC/Mac will show warning for connection. Allow connection from the device. Application logs will appear in charles.
- If Charles show the API calls as Unknown, Install SSL certification file by hitting the link http://charlesproxy.com/getssl in mobile device and install the certificate file.
- After installing certificate right click on the required API host name and select Enable SSL proxying to view the data transaction of the API call.
- Make sure client (mobile) and charles proxy tool in system are connected to same Wifi network
- System IP can be found in two ways
1. Open terminal and enter ipconfig - Windows
enter ifconfig - iOS
2. In charles tool click on Help and select Local IP address

How to get device logs for Android Devices

USB Debugging:

To take android device log from PC/Mac, USB debugging should be enabled
in device. Following are the steps to enable USB debugging:
Enable USB Debugging in Android Devices
  • Go to Settings > About phone.
  • Then move on to Build number option
  • Tap on Build number repeatedly about 7 times.
  • After touching 7th time you will see a message that, you are now a developer.
  • Now the ‘Developer options’ will be placed in Settings menu.
  • Enter ‘Developer options’.
  • Check on ‘USB Debugging’.
  • Wanring popup ‘Allow USB debugging?’ will appear.
  • Tap ‘Ok’ to confirm.
USB debugging in Android 4.0 and Later
  • Go to settings.
  • Enter ‘Developer options’.
  • Check on ‘USB Debugging’.
  • Warning popup ‘Allow USB debugging?’ will appear.
  • Tap ‘Ok’ to confirm.
With USB debugging enabled, after connecting device to any PC/Mac, device will be connected as a media device.

Getting device log:

Logs from PC/Mac:
  • Download android SDK tools. Android SDK tools can be downloaded from here: http://developer.android.com/sdk/
  • In tools folder, there is a tool ‘monitor’. Open monitor.
  • Connect the device with PC/Mac. Make sure USB debugging is enabled in device.
  • Device will appear at top right ‘Device’ panel. Select the device (i.e. Nexus 5.1).
  • Device log should appear at the bottom ‘Logcat’ panel.
  • Device log can be filtered with log tag or other parameters.
  • Select the necessary logs.
  • Tap on ‘Save’ button to save.
  • Device log will be saved as text file.
As numerous logs are recorded, clearing logs after saving would save redundancy in saved logs.
Logs from device:
There are many apps to record device log in google play store. The app CatLog’ is a convenient one. Note that rooting might be required for devices to record logs using CatLog. Following are steps to record device log using CatLog:
  • Download ‘CatLog’ from google play store.
  • Open CatLog. Keep this app in background while testing app.
  • When device log needs to be saved, open CatLog.
  • Tap on android options button on device.
  • From these options device log can be saved in device or can be sent to =
    an email address as text file.

Software Testing Types




Black box testing – Internal system design is not considered in this type of testing. Tests are based on requirements and functionality.

White box testing – This testing is based on knowledge of the internal logic of an application’s code. Also known as Glass box Testing. Internal software and code working should be known for this type of testing. Tests are based on coverage of code statements, branches, paths, conditions.
Unit testing – Testing of individual software components or modules. Typically done by the programmer and not by testers, as it requires detailed knowledge of the internal program design and code. may require developing test driver modules or test harnesses.
Incremental integration testing – Bottom up approach for testing i.e continuous testing of an application as new functionality is added; Application functionality and modules should be independent enough to test separately. done by programmers or by testers.
Integration testing – Testing of integrated modules to verify combined functionality after integration. Modules are typically code modules, individual applications, client and server applications on a network, etc. This type of testing is especially relevant to client/server and distributed systems.
Functional testing – This type of testing ignores the internal parts and focus on the output is as per requirement or not. Black-box type testing geared to functional requirements of an application.
System testing – Entire system is tested as per the requirements. Black-box type testing that is based on overall requirements specifications, covers all combined parts of a system.
End-to-end testing – Similar to system testing, involves testing of a complete application environment in a situation that mimics real-world use, such as interacting with a database, using network communications, or interacting with other hardware, applications, or systems if appropriate.
Sanity testing - Testing to determine if a new software version is performing well enough to accept it for a major testing effort. If application is crashing for initial use then system is not stable enough for further testing and build or application is assigned to fix.
Regression testing – Testing the application as a whole for the modification in any module or functionality. Difficult to cover all the system in regression testing so typically automation tools are used for these testing types.
Acceptance testing -Normally this type of testing is done to verify if system meets the customer specified requirements. User or customer do this testing to determine whether to accept application.
Load testing – Its a performance testing to check system behavior under load. Testing an application under heavy loads, such as testing of a web site under a range of loads to determine at what point the system’s response time degrades or fails.
Stress testing – System is stressed beyond its specifications to check how and when it fails. Performed under heavy load like putting large number beyond storage capacity, complex database queries, continuous input to system or database load.
Performance testing – Term often used interchangeably with ‘stress’ and ‘load’ testing. To check whether system meets performance requirements. Used different performance and load tools to do this.
Usability testing – User-friendliness check. Application flow is tested, Can new user understand the application easily, Proper help documented whenever user stuck at any point. Basically system navigation is checked in this testing.

Install/uninstall testing - Tested for full, partial, or upgrade install/uninstall processes on different operating systems under different hardware, software environment.
Recovery testing – Testing how well a system recovers from crashes, hardware failures, or other catastrophic problems.
Security testing – Can system be penetrated by any hacking way. Testing how well the system protects against unauthorised internal or external access. Checked if system, database is safe from external attacks.
Compatibility testing – Testing how well software performs in a particular hardware/software/operating system/network environment and different combination s of above.
Comparison testing – Comparison of product strengths and weaknesses with previous versions or other similar products.
Alpha testing – In house virtual user environment can be created for this type of testing. Testing is done at the end of development. Still minor design changes may be made as a result of such testing.
Beta testing – Testing typically done by end-users or others. Final testing before releasing application for commercial purpose.

Run Android Apps in Chrome Browser in Windows, OS X and Linux

Unofficially, now it is possible to run any Android app in Chrome browser on Windows, Mac and Linux!! Here is how you can make it w...