Problem statement: "error: pathspec 'develop-branch' did not match any file(s) known to git"

The case error: pathspec 'develop-branch' did not match any file(s) known to git is observed sometimes when we don't have included the remote branch viz- develop-branch in the intended local repository in which we are working on. 

So, to include remote branches (a git branch created by another developer) we need to run the below command and this ll resolve our problem.

Command : git fetch

The above command will include all the remote branches which have been created in the same local repository. 

What all data types are present in the javascript?

Note: We use typeof operator to check the data type of a variable.

We have two major data types to categorize the data types:

1.Primitive Types:

a) Number - Syntactically it is written without quotes. It represents a number which can contain decimal or non decimal values.

e.g; let x = 3.2; // decimal value

let y = 2; // integer value

b) String - It is always written down using quotes(single or double quotes upto you). It represents a series of characters.

e.g; name = 'Ananya';

name = "Arpita";


c) BigInt - It is used to store a large integer number. Syntactically it always ends with 'n'.

e.g; let number = 2345678838390123456789012345678901234567890;


d) Boolean - It is used to show logical entities and show output either true or false.

e.g; let something = true; // it can also be written as let something:Boolean  = true;


Note: Booleans are generally used for conditional testing purposes.


f) Symbol - This data type is newly introduced in the ES6 version of javascript. It is used to store an anonymous and unique values.

e.g; let x = Symbol('symbol');


g) Undefined - When a variable is only declared but no value is assigned to it, then it has a value 'undefined' and it’s data type is also undefined.

e.g; let x;

let x = undefined;

Note: Value in both the cases is undefined.


h) Null - It is used to show a non-existent or an invalid value.

e.g; let x = null;


Note : typeof(data type) of primitive types >>>>

typeof "Anamika Singh" // Returns "string"

typeof 33.14 // Returns "number"

typeof true // Returns "boolean"

typeof 56653467890123456789012345678901234567890n // Returns bigint

typeof undefined // Returns "undefined"

typeof null // Returns "object" (represent as a bug in JavaScript)

typeof Symbol('symbol') // Returns Symbol


2.Non-primitive types:

Primitive data types can store only a single type of value(either string or number or boolean and so and so). To store multiple and complex values, non-primitive data types are used.

Object - Used to store collection of data.

// Data in key-value pairs

let data = {

   x:  453,

   y:  "Hello hi",

   z: function(){

      return this.x;

   }

}

      

OR

    

var data = [7, "hi", true, 94.1];   


*Note- Remember that any data type that is not primitive data type, it's typeof is Object in javascript.



What is POSTMAN and why should we use it?

POSTMAN is an efficient tool for automation testing. Generally RESTfull APIs are being tested by developers and testers. Here we are gonna learn how to download and install POSTMAN and how to test several RESTful APIs.


1.0 Download and install POSTMAN : 


After download and install we need to configure our POSTMAN app for further usage :

When we will open POSTMAN will see the below window then to configure the app we need to follow a set of instructions --






In the last image you can select the method type of API from GET, POST, PATCH and PUT and here we go --
Further we'll continue in the next upcoming post.

  

Steps to test RESTful/REST APIs -- GET API Testing

Below are the steps to follow, while doing GET API testing with POSTMAN:

1. Go to POSTMAN runner window.

2. Put intended URL in the upper box and select method type - GET

3. Below URL, go to headers and for key value pairs use the below information-

key       ---> Content-Type 

key       ----> Authorization


Content-Type   ----> application/json

Authorization   ---->  

eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImUwMDZjYjY0LTVjOWYtNGMwMi1hODNlLWE2YzVlMTg1NjdkNiIsIm5hbWUiOiJpQ29uX2FkbWluIiwicm9sZV9pZCI6ImI2MmFkNjdjLTdhOTYtNGE0ZS04YWIzLWYzNDQ1OGVmMmNlOCIsImV4cCI6MTYwMjc1MDUxMS43Mzc4MTF9.fvOfPyFHrYAwEg_HEetjUxjcD2tzWOBqzp5cDlchLo4

Note : Since method type is GET, so don't need to put anything inside body.

Now hit send button at the right top corner.

Now select JSON type(if it is not selected by default) to see response inside response window.

Below are the screenshots attched for reference:

1. Take Authorization token from the application:



2. Set params in POSTMAN window:



3. Hit send button and get the response:






Steps to test RESTful/REST APIs -- PATCH API Testing

 Below are the steps to follow, while doing PATCH API testing with POSTMAN:

1. Go to POSTMAN runner window.

2. Put intended URL in the upper box and select method type - PATCH

3. Below URL, go to headers and for key value pairs use the below information-

key       ---> Content-Type 

key       ----> Authorization

4. Set body params in JSON format

Content-Type   ----> application/json

Authorization   ---->  

eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImUwMDZjYjY0LTVjOWYtNGMwMi1hODNlLWE2YzVlMTg1NjdkNiIsIm5hbWUiOiJpQ29uX2FkbWluIiwicm9sZV9pZCI6ImI2MmFkNjdjLTdhOTYtNGE0ZS04YWIzLWYzNDQ1OGVmMmNlOCIsImV4cCI6MTYwMjc1MDUxMS43Mzc4MTF9.fvOfPyFHrYAwEg_HEetjUxjcD2tzWOBqzp5cDlchLo4


Now hit send button at the right top corner.

Now select JSON type(if it is not selected by default) to see response inside response window.

Below are the screenshots attached for reference:

1. Take Authorization token from the application:



2. Set header params in POSTMAN window:



4. Set body params in POSTMAN window:



3. Hit send button and get the response:



How to convert an array into object?

let obj = {};

let arr = {

"ip": "42.108.232.79",

"type": "ipv4",

"continent_code": "AS",

"continent_name": "Asia",

"country_code": "IN",

"country_name": "India"

            }

obj = Object.assign({}, arr);

console.log(obj);


Result : 

Object

type: "ipv4",

continent_code: "AS",

continent_name: "Asia",

country_code: "IN",

country_name: "India"

ip: "42.108.232.79"

__proto__: Object

Steps to test RESTful/REST APIs -- POST API Testing

Below are the steps to follow, while doing POST API testing with POSTMAN:

1. Go to POSTMAN runner window.

2. Put intended URL in the upper box and select method type - POST

3. Below URL, go to headers and for key value pairs use the below information-

key       ---> Content-Type 

key       ----> Authorization

4. Set body params in JSON format

Content-Type   ----> application/json

Authorization   ---->  

eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImUwMDZjYjY0LTVjOWYtNGMwMi1hODNlLWE2YzVlMTg1NjdkNiIsIm5hbWUiOiJpQ29uX2FkbWluIiwicm9sZV9pZCI6ImI2MmFkNjdjLTdhOTYtNGE0ZS04YWIzLWYzNDQ1OGVmMmNlOCIsImV4cCI6MTYwMjc1MDUxMS43Mzc4MTF9.fvOfPyFHrYAwEg_HEetjUxjcD2tzWOBqzp5cDlchLo4

Now hit send button at the right top corner.

Now select JSON type(if it is not selected by default) to see response inside response window.

Below are the screenshots attached for reference:

1. Take Authorization token from the application:


2. Set header params in POSTMAN window:



4. Set body params in POSTMAN window:



3. Hit send button and get the response:



Older Posts

Older Posts with different categories