Automation Step by Step

API Testing using POSTMAN (Manual Testing)

We can use POSTMAN for REST API Testing
We can either download POSTMAN or Google chrome Add-ons

Pre Requisite Before Start To API Testing
1)POSTMAN
2)API URI
3)Payload for request

HTTP Requests methods require for API Testing using Postman
Create a record (POST)
Retrive/Verify Data (GET)
Update record (PUT)
Delete record (DELETE)


Domain :-https://www.google.com/
URI:- /search?source=hp&ei=NgQcXqDyNKfTz7sPpduz2Aw&q=selnium


EndPoint require for API Testing

Ex.
http://restapi.demoqa.com/utilities/weather/city/

Complete URI:-
http://restapi.demoqa.com/utilities/weather/city/Paris

Request Payload require for POST method
{

"FirstyName" : "Vaibhav",
"lastName" : "Khachane",
"UserName" :"tester",
"Password" : tester@123
"Email" :"test@gmail.com"

}

We should observe following things while doing API Testing manually
1)Response Body
2)Cookies
3)Header
4)Status Code

Practice API :
https://reqres.in/
https://restcountries.eu/
https://openweathermap.org/current

API Testing Validation

Reference API:-http://restapi.demoqa.com/utilities/weather/city/Paris

Step 1: Launch POSTMAN Tool
Step 2: Select GET Method and Enter API ex. "http://restapi.demoqa.com/utilities/weather/city/Paris"
Step 3: Click on SEND Button
Step 4: Verify Response Output Manually.

Now Add Verification Points 

Step 5: Go to the "Test"
Step 6: Click on "Response headers:content-Type header check"
, It will add code example. 
                         pm.test("Content-Type is present", function () {
                         pm.response.to.have.header("Content-Type");
                         });
Step 7: Modify Code as per our requirement. example 
                        pm.test("Content-Type is present", function () {
                        pm.response.to.have.header("Content-Type");
                       });

Above Test Case will check content-Type

We can write test cases for other scenarios also

TC: To verify Status code
                       pm.test("Status code is 200", function () {
                       pm.response.to.have.status(200);
                       });

TC: To verify response time
                      pm.test("Response time is less than 200ms", function () {
                      pm.expect(pm.response.responseTime).to.be.below(1000);
                      });

TC  : To verify response Objects
                     tests["City id is correct"]=responseBody.has("City");
                     tests["Temperature id is correct"]=responseBody.has("Temperature");
                     tests["Humidity id is correct"]=responseBody.has("Humidity");
                     tests["WeatherDescription id is correct"]=responseBody.has("WeatherDescription");
                     tests["WindSpeed id is correct"]=responseBody.has("WindSpeed");
                     tests["WindDirectionDegree id is correct"]=responseBody.has("WindDirectionDegree");

TC : To verify Response Values

                     pm.test("City Name is Correct", function () {
                     var jsonData = pm.response.json();
                     pm.expect(jsonData.City).to.eql("Paris");
                     console.log("I am getting this value from API ",jsonData.City);
                     });

                    pm.test("Temperature value is correct", function () {
                    var jsonData = pm.response.json();
                    pm.expect(jsonData.Temperature).to.eql("9.51 Degree celsius");
                    console.log("I am getting this value from API ",jsonData.Temperature);
                    });

                    pm.test("Humidity value is correct", function () {
                    var jsonData = pm.response.json();
                    pm.expect(jsonData.Humidity).to.eql("70 Percent");
                    console.log("I am getting this value from API ",jsonData.Humidity);
                    });

                    pm.test("WeatherDescription value is correct", function () {
                    var jsonData = pm.response.json();
                    pm.expect(jsonData.WeatherDescription).to.eql("broken clouds");
                    console.log("I am getting this value from API ",jsonData.WeatherDescription);
                    });

                   pm.test("WindSpeed value is correct", function () {
                   var jsonData = pm.response.json();
                   pm.expect(jsonData.WindSpeed).to.eql("8.7 Km per hour");
                   console.log("I am getting this value from API ",jsonData.WindSpeed);
                   });
  
  
                   pm.test("WindDirectionDegree value is correct", function () {
                   var jsonData = pm.response.json();
                   pm.expect(jsonData.WindDirectionDegree).to.eql("210 Degree");
                   console.log("I am getting this value from API ",jsonData.WindDirectionDegree);
                   });

We can view API return values on POSTMAN console . Following are steps
1)Go to view-> Show Postamn console

following line will help to fetch value on console
console.log("I am getting this value from API ",jsonData.City);
TC : To verify Schema use tiny validator for JSON data Use This Link to generate schema var schema = { "items": { "type": "boolean" } }; var data1 = [true, false]; var data2 = [true, 123]; pm.test('Schema is valid', function() { pm.expect(tv4.validate(data1, schema)).to.be.true; pm.expect(tv4.validate(data2, schema)).to.be.true; }); GUI for Test Result
POSTMAN Tool GUI
                        NOTE:- REST API support JSON format . It is also support XML , Text, HTML format. SOAP only support XML format.

How to perform a Windows-based App Retesting.


Before update bug fixes into the windows based application , We should have an updated patch shared by the development team.

1)Closed application and stopped all running services respective to the application
2)Go the app installation drive ex. "C" Drive.
3)Go to the Program Files-> Application Folder-> "ABC"
4)Copy all updated patch files and replace them into the project folder. Ex. ABC
5)Then launch the application. Your bug fixes should be reflected in the application.


How to measure Web Traffic

How to find log of Android and iOS Devices

To Verify Android Device log We can use ADB 
Make Sure ADB should be installed properly
Refer following commands to get device log
adb devices ENTER :- To check list of connected deivces to the machine
adb logcat  ENTER:- To check complete log of device
adb logcat>C:\Users\user1\Desktop\log.txt  ENTER:- To save complete device log

Note: for macboon, adb logcat> ~/Desktop/abc.txt

adb logcat -c  ENTER:- To clear log
To Verify IOS Device log We can use XCODE Launch XCODE Go to the menu bar: Window → Devices and Simulators.
Click View Device Logs
Right-click on the App Crash and select Export Log
Enter the log file name and the destination then click Save
Second Way: Go to the menu bar: Window → Devices and Simulators.
Alternative App for Gathering iOS Device Logs – iOS Console Third Way:- Besides the options above, you can also obtain iOS device logs using the iOS console app. Follow these steps: Install iOS Console Connect your iPhone to the computer Select Trust this computer on the iPhone pop-up request Start iOS Console and you will see the iOS device logs being gathered. Reproduce the problem Highlight all of the log data

Android and iOS App Human Interface Guidelines

Errors getting while installing Android Studio on Windows 8


I have tried to install android studio on my machine
configuration
OS: Windows 8 64 bit
Processor: Pentium Dual-Core 2.70Ghz
RAM: 4GB
HDD: 500GB

I have got the following error while running ADB 
The above error has got while using Genymotion. But the same thing is working fine on same machine using Windows 10. Recommended COnfiguration for ANdroid studio is following

How to Record Mobile Device Screen


We can record mobile screen from desktop using Airdrod.
Mobile Device Screen Recorder

We can record Android mobile screen
Android Mobile Device Screen Recorder


We can record iOS mobile screen
iOS Mobile Device Screen Recorder

Screen Recording Addons of Google Chrome