Sunday, April 9, 2023

API Methods

 HTTP(Hypertext transfer protocol) it is a protocol used by world wide web for exchanging the data between each other or you can say in between servers & clients.

Safe Method: - It is a method which only retrieves the data from the server and does not modify the server state.

Idempotent Method: - It is a method which produces the same result whenever called once or multiple times.

1)    GET: - With the help of this http method you can get the data from the server which is already present on the server. Get method is safe and idempotent in nature, means after hitting multiple requests to the server every time it will provide same result to the user.

2)    POST: - With the help of this http method you can create a record on the server. The Post method is not idempotent in nature, means multiple requests for the same resource can result in different state on the server.

 

3)    PUT: - This method is used to update the data on the server, it is idempotent in nature, means after hitting multiple requests to the server every time it will provide same result to the user.

 

4)    PATCH: - This methos is used to update date on the server partially. It is not idempotent.

 

5)    DELETE: - This methos is used to delete data on the server. It is idempotent in nature, means after hitting multiple requests to the server every time it will provide the same result to the user.

 

6)    HEAD: - Working of this method is similar to GET method, but it will retrieve only headers of the resource, not body. The HEAD method is useful for checking the existence of a resource and it’s properties without retrieving the entire resource.

 

7)    OPTIONS:  - This is used to retrieve the list of HTTP methods supported by the resource. Server responds with list of methods in the allow the header of response.

 

8)    TRACE: - This method performs diagnostic test by returning the full request received by the server. It is mainly used for debugging & troubleshooting purposes.


Sunday, April 2, 2023

Selenium Commands Regularly Used

     Following commands are used with "Navigate" function of selenium.

       1) to(String url) :-  To open the specified URL.
2) to(URL url) :- To open the specified URL.
3) back() :- To redirect back in the browser history.
4) forward() : -  To redirect forward in the browser history.
5) refresh() :-  To refresh the current page.

    Following commands are used to manage the browser.

1) get(String url) :- To open the specified URL.
2) getCurrentUrl() :- To get the URL of current webpage.
3) getTitle() :- To get the title of the current page.
4) close() :- To close the current window(Tab).
5) quit() :- To close the complete browser.

 Following commands are used to search the webelements.

1) findElement(By by) :- This command will provide first element matching the specified criteria.
2) findElements(By by) :- This command will provide all elements which are present on webpage & matching the specified criteria .                                                         

 Following commands are used to perform manipulation on webelement.

1) click() :- Click on an element.
2) submit() :- Submit a form.
3) sendKeys(CharSequence... keysToSend) :- Send the specified keys to an element.
4) clear() :-  Clear the text from a text field.







Disclaimer:

This blog is related to software testing, automation testing, and their functioning. To write the blog I have referred lots of testing sites, material etc. If anyone has any issue about blog/written content or have any kind of suggestions then please write an email to me @ kprathmesh1992@gmail.com
Disclaimer of warranty: Software-Testing-Hub provides the Services to you as is. You use them at your own risk and discretion. That means they don’t come with any warranty. None expressed, none implied. No implied warranty of merchantability, fitness for a particular purpose, availability, security, title or non-infringement.