Where we learn technology

Tag: Maven

API/WebServices – BackEnd Manual & Automation Testing – Regular Batch – 11th July 2024 – 8 PM IST / 10:30 AM EST / 7:30 AM PST)

WebServices – Back End API Manual & Automation Training Course Content

Starting Date: July 11th, 2024

API Testing Training/Boot Camp:

The API testing batch/boot camp training for API/WebServices – Back End Manual & Automation Testing is a crucial training for individuals who want to enhance their skills in API testing. This training will cover essential topics related to API testing such as HTTP methods, RESTful APIs, JSON/XML, authentication, authorization, error handling, and much more. Candidates will learn both manual and automated testing methods for APIs.

Who can attend this training?

This training is perfect for software testers, quality assurance engineers, developers, and anyone interested in gaining knowledge and skills in API testing. Candidates will learn how to test APIs effectively, identify defects, and ensure that APIs are functioning as expected.

Additionally, this training will help individuals gain a competitive advantage in their careers by acquiring new skills and knowledge.

Why should I join this?

By attending this training, individuals will be better prepared for API testing interviews as they will have a solid understanding of API testing concepts, methods, and tools. They will be able to apply their knowledge to real-world scenarios and will have hands-on experience with various testing tools used in the industry. Overall, this API testing batch/boot camp training is an excellent investment for individuals looking to enhance their career opportunities and take their skills to the next level.

Next Batch Starting from: 11th July, 2024

Duration: 9-10 Weeks

Location: Online (zoom meeting) 

Duration: 3 days in a week (1.5 hrs) – Mon – Wed – Thursday

Timings

    • 8:00 PM IST (Indian Time)

    • 10:30 AM EST (USA Eastern Time)

    • 7:30 AM PST (USA Pacific Time)

    • 9:30 AM CST (USA Central Time)

    • 3:30 PM UK TIME

Registration Fee: For Candidates in India : 3000 INR

For Candidates in USA/UK/NZ/AUS/Europe : 55 USD

Remaining Course Fee

    • 12000 INR (For Candidates in India)

    • 200 USD (For Candidates in US/UK/NZ/AUS/Europe)

Note:

    • There will be 2 demo sessions. If you don’t want to proceed with the training, full Registration amount will be refunded back to you.

    • After 2 demo sessions, remaining amount (12000 INR/200 USD) must be paid accordingly.

    • For any query, whats app at: +91-9902233400.

 
Here I’m sharing the payment details. Please send me the screenshot of receipt once you make the payment without fail. 
You need to mail me at : naveenanimation20@gmail.com

 Payment Options:

CANDIDATES IN INDIA:
1. Pay by Credit/Debit Card:
If you want to use credit card/debit card, please use this secured stripe payment link:

REGISTRATION FEE (3000 INR):
https://buy.stripe.com/28obL2bjD6Ww5RC4hC

REMAINING FEE(12000 INR):
https://buy.stripe.com/4gwcP60EZ4Oocg015j

Or you can pay total fee (15000 INR):  
https://buy.stripe.com/00g16o3Rb3Kk93O9BR
2. BANK TRANSFER:

Bank Details:
Full Name: NAVEEN KHUNTETA

Payee name: NAVEEN KHUNTETA

Name of the Bank: ICICI bank

Address of the Bank: Bhandarkar Road, Pune

Bank Account Number: 624001553272

IFSC Code(11 Digit Code): ICIC0006240

3. Pay by GPay/PhonePe/Paytm/UPI:

ph: 9902233400 / 9828866542
======================================
CANDIDATES IN USA/CANADA/UK/EUROPE/AUS/OTHERS:
1. If you want to use credit card/debit card, please use this secured stripe payment link:
REGISTRATION Fee (55 USD):
https://buy.stripe.com/5kA5mEgDX4Oodk44hD
Remaining Fee(200 USD): 
https://buy.stripe.com/fZe5mEfzTeoY6VGdSe
You can pay full amount (255 USD):
https://buy.stripe.com/3cscP63Rb0y84Ny15t
2. Bank Transfer:

Please find below bank details. You can make the transaction directly to the given account or make it via Western Union (only via bank transfer) / Xoom/ Remitly or any other remittance.


Bank Details:

Name: Naveen Khunteta

Bank Account Number:  1015794367401

IBAN Number:  AE520260001015794367401

City/Country: Dubai, UAE

Swift Code: EBILAEAD

Address: Naveen automation labs FZCO, Scaltiy, building 9W, DAFZA, Dubai, UAE - 000001
3.  Paypal:
Total payment: 265 USD
Use this PayPal id: https://paypal.me/naveenautomation
Check out with PayPal
Note: If you are paying through PayPal, You need to pay 265 USD (10 USD will be the PayPal Fee).
 
 

Syllabus Course Content:

Course Content:

 Testing of WebServices/API:

  1. Introduction of API and WebServices:
    1. What is API
    2. What is WebService
    3. What is Backend Architecture
    4. Rest vs SOAP APIs
    5. What is CRUD operation with different examples
    6. What are different HTTP Calls – GET/POST/PUT/Delete/PATCH/HEAD/OPTIONS
    7. Different Live Projects Examples
  2. Postman:
    1. Introduction
    2. How to call Rest API in Postman
    3. How to pass path parameter in Request
    4. How to pass query parameter in Request
    5. How to set Headers in Postman
    6. How to pass JSON/XML Payload
    7. How to check response status code
    8. How to check JSON/XML response messages
    9. What is response header
    10. Cookies manipulation
    11. Header Presets
    12. API History in Postman
    13. Postman Environment Variables
    14. Postman Test Scripts using Javascript and  Chai Assertions
    15. Run Automated Test Cases in Postman and generate the results
  3. Advance Postman/Newman:
    1. Introduction of Newman
    2. Newman installation/setup
    3. How to run collections from Newman
    4. Newman command line options
    5. Generate HTML Test Report
    6. Create a collection and folders
    7. Create a collection from API Specification or API Schema
    8. maintenance of API collections
    9. Postman Console and logs
    10. Test Script in postman
    11. Pre Request Script in postman
    12. Test Code snippet in postman
    13. Monitoring of APIs
    14. API Documentation
    15. API Documentation/CODES in different programming languages
    16. Publish Documentation
    17. Setup Environment – Local and Global
    18. Collection Runner
    19. Collection Test Summary
    20. Creating a Mock Server for APIs
    21. How to create a team workspace
    22. How to create individual workspace
    23. Import in Postman
    24. Basic and Advanced Settings in Rest Client
    25. Running postman collection with Docker
    26. Running postman collection with Jenkins
  4. How to check APIs at the network layer using developer tools of browser:
    1. How to check Backend services – APIs running behind
    2. What is developer tool in Chrome
    3. How to check request/response of any API in Firefox/Chrome browsers
  5. What are different HTTP Status Response Codes:
    1. 1xx series
    2. 2xx series
    3. 3xx series
    4. 4xx series
    5. 5xx series

Automation Testing of Back End/APIs:

  1. Learn various HTTP Client libraries :
    1. Tools/Library: JDK 11 – HTTP Client
    2. All CRUD – GET/POST/PUT/Delete Calls
    3. How to send Request with Payloads
    4. How to send Query Parameters and Path Parameters
  1. Learn Rest Assured DSL Java Client API:
    1. Introduction of Rest Assured
    2. Rest Assured methods: GET/POST/PUT/Delete/Patch
    3. Handle different payloads using POJO and JSON/XMLs:
    4. Request with Simple JSON format
    5. Request with Complex JSON format
    6. Handle Authentication using Basic Auth, Preemptive Auth, Digest Auth, Bearer Token, Authorization Token, Client ID, Client Secret, API Key, API Secret, OAuth1 and OAuth2
    1. All core features of Rest Assured Library:
      1. GET/POST/PUT/DELETE – Inbuilt BDD Approaches
        1. What is GIVEN/WHEN/THEN/AND methods
        2. What is LOG and ALL methods
        3. How to ASSERT in Rest Assured
        4. How to verify Status Code, Response Body and Headers
        5. How to use QUERY PARAMETERS and PATH PARAMETERS
        6. What is ResponseBuilderSpec and RequestSpecification Concept
        7. What is JSON PATH/XML Path
        8. What is EXTRACT method
        9. How to send a POST CALL with JSON String, JSON File and using Java (POJO) Class.
        10. What is Serialization and De-Serialization
        11. How to use HAMCREST – Assertion Library
      2. GET/POST/PUT/DELETE – NON-BDD Approaches
    2. New End to End Framework using Rest Assured using different real time APIs:
      1. How to setup a Maven Project for APIs
      2. Folder Structure
      3. API Test Automation Design and components
      4. Rest Client Libraries
      5. Write API Automated Tests with TestNG
      6. Data Providers with Parameterization
      7. Data Driven Testing with Excel Files – using Apache POI API
      8. Test Runners with testng.xml
      9. Various Constants Files for Errors, Status Codes, Validation, and Success Messages
      10. Create a GIT Repo for Test Automation project:
        • Create a New Repo
        • Clone a Repo
        • GIT PUSH
        • GIT PULL
        • GIT Check OUT
      11. Integration with Jenkins – CI CD Pipeline and Automation Job
      12. Create the docker Image of API Test Automation
      13. Host/Register docker image to Docker HUB
      14. Download the docker image and Run it on any machines
      15. Advanced Reporting : Extent Report/TestNG Report/Allure Report
      16.  Maven: Build Automation Tool: Run your API Automation Framework from Maven
      17. TestNG Framework for API test cases

8. Mocking APIs using Wiremock library:

  1. Define the dummy APIs
  2. Define API Mock Behaviour for GET/POST Calls
  3. Call Mocking APIs 
  4. Integrate it in your Test Automation

9. Real Time API Examples:

  1. GORest APIs with Authentication
  2. ReqRes.in
  3. Booker APIs
  4. Weather APIs
  5. IMDB APIs
  6. Weather/Forecast Real Time APIs
  7. OAuth APIs
  8. GIT HUB APIs
  9. Twitter APIs
  10. API with Swagger

10 . Life Time Free Access on all the Videos/Recordings/Codes/Notes/PDFs/Cheat Sheets.

 
Cheers!
Naveen AutomationLabs
 

WebDriverManager Implementation with Selenium WebDriver.

WebDriverManager is an API that allows users to automate the handling of driver executables like chromedriver.exe, geckodriver.exe etc required by Selenium WebDriver API.

Now let us see, how can we set path for driver executables for different browsers like Chrome, Firefox etc. in a traditional way.

In general, to automate web applications we need to download driver executables manually for required browsers. Once driver executables are downloaded into local system then we need place them in a specific path and set path for driver executables that becomes very tedious task to maintain driver executables as and when browser version changes.

In below code, we can see how to set path for driver executables in a traditional way.

//For Chrome Browser
System.setProperty("webdriver.chrome.driver", "./Drivers/chromedriver.exe");

//For Internet Explorer Browser
System.setProperty("webdriver.ie.driver", "./Drivers/IEDriverServer.exe");

//For Firefox Browser
System.setProperty("webdriver.gecko.driver", "./Drivers/geckodriver.exe");

It’s a good practice to maintain driver executables under project directory as shown below.

Now let us see the disadvantages of following traditional approach over WebDriverManager to maintain driver executables and setting path for the same.

1. We need to download driver executables manually and set path for the same.

2. As and when browser version is updated, we need to download driver executable/s that can be matched with latest browser version.

3. We need to set exact path for driver executable/s else we get illegalStateException. [When we try to launch browser without setting correct path for driver executable/s]

Now the question is how can we overcome doing above manual stuff using WebDriverManager.

Pre-Condition:

Project should be Maven. In pom.xml file we need to add below dependency to have WebDriverManager in our Project.

<dependency>
	<groupId>io.github.bonigarcia</groupId>
	<artifactId>webdrivermanager</artifactId>
	<version>3.7.1</version>
</dependency>

Once WebDriverManager is added into pom.xml. Update Maven Project and ensure that WebDriverManager Jar is added into Project Build Path under Project Maven Dependencies folder as shown below.

 

Notice that simply adding WebDriverManager.chromedriver().setup(); 

WebDriverManager does magic for you:

  1. It checks the version of the browser installed in your machine (e.g. Chrome, Firefox).
  2. It checks the version of the driver (e.g. chromedrivergeckodriver). If unknown, it uses the latest version of the driver.
  3. It downloads the WebDriver binary if it is not present on the WebDriverManager cache (~/.m2/repository/webdriver by default).
  4. It exports the proper WebDriver Java environment variables required by Selenium (not done when using WebDriverManager from the CLI or as a Server).

WebDriverManager resolves the driver binaries for the browsers ChromeFirefoxEdgeOperaPhantomJSInternet Explorer, and Chromium. For that, it provides several drivers managers for these browsers. These drivers managers can be used as follows:

WebDriverManager.chromedriver().setup();
WebDriverManager.firefoxdriver().setup();
WebDriverManager.edgedriver().setup();
WebDriverManager.operadriver().setup();
WebDriverManager.phantomjs().setup();
WebDriverManager.iedriver().setup();
WebDriverManager.chromiumdriver().setup();

 

 

Now we are good to use WebDriverManager in Test Scripts.

//For Chrome Browser
WebDriverManager.chromedriver().setup();

//For Internet Explorer Browser
WebDriverManager.iedriver().setup();

//For Firefox Browser
WebDriverManager.firefoxdriver().setup();

Likewise we can setup driver executables for other browsers like edge, opera etc using WebDriverManager which launches a browser.

//Below is the sample code to launch Chrome Browser using WebDriverManager
public class WebDriverManagerChrome 
{
        @Test
	public void webDriverManagerChrome()
	{
		WebDriverManager.chromedriver().setup();
		WebDriver driver = new ChromeDriver();
		driver.manage().window().maximize();
		driver.manage().deleteAllCookies();
			
		driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
		driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
		
		driver.get("https://classic.crmpro.com/index.html");
         }
}

When we setup WebDriverManager in Project. By default, it downloads the latest version for a specified driver executable/s. Using WebDriverManager, we can also setup driver executable/s for a specific browser version.

//Code Snippet for Chrome Browser
WebDriverManager.chromedriver().version("2.40")

Now let us see the difference between WebDriverManager and Traditional way of setting up driver executables to launch browsers.

WebDriverManager.chromedriver().setup(); ==>> It will automatically downloads the Driver Executable/s.

System.setProperty(“webdriver.chrome.driver”, “./Drivers/chromedriver.exe”); This will setup driver executable for a specific browser based on the location that we have provided where we downloaded and placed driver executable/s.

Note: WebDriverManager is not part of Selenium WebDriver API.

Refer below Git Repository for WebDriverManager implementation with Maven Project.

https://github.com/PavanReddy77/SeleniumWebDriver_4

In this blog, we have seen setting up WebDriverManager for a Maven Project to work with Selenium WebDriver API.

 

Cheers!!

Naveen AutomationLabs

Blog Contributors:

Author:  Pavan K

Pavan, having good knowledge in Selenium Web UI and API Automation frameworks. Also, he is helping QA community with his knowledge along with Naveen AutomationLabs!!

LinkedIn

Reviewer: Naveen Khunteta 

https://www.linkedin.com/in/naveenkhunteta

Steps to Configure Maven Profile with Maven Project

Let us see how to configure Maven Profile for a Maven Project.

What is a Maven Profile..??                                                               

It is a feature that can be defined in a pom.xml file which allows developers and testers to configure and customize builds based on requirement. 

What is the advantage of implementing Maven Profile in our Automation Projects..??                                                                 

As shown below, In real time we generally maintain different testng.xml files in frameworks that are designed either for Web Applications, Backend APIs or Mobile Applications like Smoke Suite, Regression Suite, Sanity Suite etc. for executing test cases based on requirement.             

Based on business requirement, we will be required to execute testng.xml files from Eclipse IDE, Command Prompt or from Jenkins etc.

In general, if we do not use Maven Profiling. Each time when we need to execute testng.xml file. We need to go to pom.xml file and change the name of testng.xml inside Maven Surefire Plugin which needs to be executed and that is a very tedious task to do every time.  Now the question is, how can we avoid changing testng.xml file name in pom.xml every time. when we need to execute test suite.

Now let us see configuring Maven Profile with Maven Project.

1. Project should be a Maven Project. 

2. Maven Jar files should be downloaded and path must be set for the same in Environment Variables and ensure that you are able to execute Maven Project from Command Line prompt before implementing Maven Profile. 

Refer below blog with respect to above points to Install Maven Jars and to execute Maven Project from Command Prompt:  http://naveenautomationlabs.com/executing-maven-project-in-windows-from-command-prompt/

Below is Maven Surefire Plugin where we mention which testng.xml file needs to be executed from project.

Code for Maven Surefire Plugin:                                                     

<build>
 <pluginManagement>
 <plugins>
 <plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-surefire-plugin</artifactId>
 <version>2.18.1</version>
 <configuration>
 <suiteXmlFiles>
 <suiteXmlFile>src/main/resources/testng_smoke.xml</suiteXmlFile>
 </suiteXmlFiles>
 </configuration>
 </plugin>
 </plugins>
 </pluginManagement>
 </build>

Now, let us see how can we build Maven Profile using Maven Surefire Plugin.

We can build Maven Profile for each testng.xml file in pom.xml as shown below, for each Maven Profile we can give Id/Name as highlighted in below screenshot.

All we need to add is followed tags with Maven Surefire Plugin <profiles> </profiles>, <profile> </profile> and <id> </id>.

All we need to do is that providing Id/Name for each Profile. For example, if we have multiple testng.xml files like Smoke, Sanity and Regression then we can build 3 Maven Profiles.       

One-One Profile for each suite, so that we can avoid changing testng.xml file name inside Maven Surefire Plugin whenever we need to execute test suite.

In my case, I have 2 testng.xml files. One is for Smoke and other one is for Regression.

You can refer below screenshots for giving Maven Profile Names for Test Suites.

Note: Profile Name should always be written inside <id> tag.

Refer below pom.xml to build Maven Profile for each testng.xml file.    https://github.com/PavanReddy77/MavenSurefirePlugin/blob/master/pom.xml

Once Maven Profiles are built for all testng.xml files then we are good to execute from Command Prompt or from Jenkins.

Maven Commands to be followed when executing testng.xml files. 

mvn test –P followed by Maven Profile Id like below:

mvn test –PSmoke     

mvn test –PRegression

Well, we are now good to execute our testng.xml file based on our requirement.

Refer below repository for implementing Maven Surefire Plugin and Maven Profile.  

https://github.com/PavanReddy77/MavenSurefirePlugin

Conclusion: In this blog, we have seen implementing Maven Surefire Plugin and Maven Profile in a Maven Project.

Blog Contributors:

Author:  Pavan K

Pavan, having good knowledge in Selenium Web UI and API Automation frameworks. Also, he is helping QA community with his knowledge along with Naveen AutomationLabs!!

LinkedIn

Reviewer: Naveen Khunteta 

https://www.linkedin.com/in/naveenkhunteta

Steps to Configure Maven Project with Jenkins

Jenkins is an Open Source Continuous integration tool that is written in Java which is often used in Devops.

It is mainly used by Developers and Testers, whenever Developers/Testers does any changes in Source Code then Jenkins will automatically pull the code and continuously build and test code that has been added.           

Step 1: Installing Jenkins War File.

Follow below steps to install Jenkins War File. 

Go to any browser and search by Jenkins Download as shown below and click on  below highlighted link.

After clicking on above highlighted link, you will be navigated to below page.      

Click on “Permalink to the latest” – Latest and Stable version of Jenkins War File will be installed into your local system.

Now you are good to execute your Jenkins War File from Command Prompt.

Step 2: Executing Jenkins War File from Command Prompt.

Create a separate folder in your local system and place Jenkins War file once it is downloaded. Note: We must run Jenkins.war file through Command Line Prompt.

Step 3: Use below command to Run Jenkins.war file

Note:  By default, Jenkins will always run in localhost:8080. Make sure nothing else is running on port 8080. If localhost:8080 is already occupied then you won’t be able to execute Jenkins.war file.                    In such case you can execute your Jenkins.war file in other port using below command.

Once Jenkins is successfully launched, user should be able to see below message in
Command Prompt.

“Jenkins is Fully Up and Running”.

Step 4: Now, go to browser and open localhost:8084 where you have run your Jenkins.               
In my case, I have run Jenkins in port 8084.                                                                            

When launching it for first time, you have to set username and password and install default plug-ins that suggests etc and then you will be landed on to Jenkins Dashboard Page. 

Step 5: Configure your system for Java and Maven in Jenkins as shown below                

Go to Manage Jenkins >> Global Tool Configuration.

Step 6: Install Required Plug-ins >> Go to Manage Jenkins >> Manage Plug-ins and install from Available Section.

Step 7: Create Job >> New Item >> Enter Item Name >> Select Maven Project and Click on OK. After installing all Maven Plug-ins user should be able to see Maven Project Option.

Step 8:                                                                                                                                           A. Go to General >> Enter Description of your Project.

B. Go to Maven Info Plug-in Configuration >> Select None.

C. Go to Source Code Management. [You have to select any one option from it].       

Select None, if you are not using any Source Code Management tool for maintaining Code.

Select Git and provide Repository URL and Branch Name, if you are maintaining code in Git.

D. Go to Build Triggers.                                                                                                      

You can select as shown below, if you are not scheduling jobs using CRON Command and such. [In this case you have to build a job manually].

If you have to schedule jobs automatically, select Build Periodically and use CRON Command. 

If we have to build a job automatically when in any commit happens to Git then we
can select Poll SCM and use CRON Command.                                                                 

[As soon as code commit happens to Git, it will trigger a build].

E. From Build Environment, Select None

F. From Pre Steps, Select None.

G. From Build, Enter Path for your Root POM.xml and command to be executed as shown below.                                                                                                                  
Note: When in giving Maven Command to Run Test Cases in Jenkins, ignore mvn and just give commands as below.                                                                                
clean install Or test Or test -PSmoke etc.

H. From Post Steps, you can select any option as per your requirement.

I. If you want to be notified, when in any job is getting failed then you can select Build Settings and configure it.

Note: To do this we need to do other extra configuration [You can ignore for it now].

J. Post Build Actions can be used to Generate Results. [To achieve it, we need to install required plug-ins like TestNG Plug-in, HTML Report Plug-in for Generating Extent Report]

Below Configurations needs to be done for generating Extent Reports in Project Folder.

Step 9: Apply and Save, now click on Build now to trigger your Job.

Conclusion: In this blog, we have seen how to create a Job for Maven Project, Configuring Job and Executing a Job in Jenkins.


Cheers!!

Naveen AutomationLabs

Blog Contributors:

Author:  Pavan K

Pavan, having good knowledge in Selenium Web UI and API Automation frameworks. Also, he is helping QA community with his knowledge along with Naveen AutomationLabs!!

LinkedIn

Reviewer: Naveen Khunteta 

https://www.linkedin.com/in/naveenkhunteta