Friday, 23 October 2020

SetUp API Automation Framework from scratch with build.gradle file? Rest Assured with Gradle

 STEP By Step Guide to Setup API Automation Framework with Gradle-TestNG:

 Selenium Interview E2E Guide


Step-01:

Download eclipse as IDE as mentioned in below link:
Eclipse Download

Download JDK and check inside java folder you should have both jre and jdk folder with same version. To check installation is correct or not type java -version and javac in your cmd.

Step:02

- Add TestNG to eclipse:

- To add TestNG to eclipse follow below steps:
Help-->Install New Software-->Add-->Name:TestNG & Location:http://dl.bintray.com/testng-team/testng-eclipse-release/ -->Next-->Finish

 


 


Step:03

Add Gradle to Eclipse:

Help-->Eclipse Marketplace-->Search <gradle>-->  Buildship: Eclipse Plug-ins for Gradle         





Step:04

Create Gradle project in Eclipse:
File -- > New-- > Project -- > Gradle Project-- > next-- > Next-- > Project Name-- >Finish







 

Step:05
Add all the dependencies using Gradle required for API Automation using Rest Assured.

Gradle dependencies for Rest Assured Framework Setup can be found below, Just copy the content in below link and add it in the build.gradle:
https://automationreinvented.blogspot.com/2020/10/configure-gradle-dependencies-in.html

 

Step:06

Once all the above dependencies added then Right click on the project Select Gradle -- > Refresh Gradle Project


Check below link for question SET-01:
Top API Interview Question 1-10
 
Check below link for question SET-02:
Top API Interview Question 11-20  
For Online Training on SDET contact 9619094122, starting new batch from November First week. 
Want to learn more? ...Check below link for more java interview question:

Monday, 19 October 2020

Configure Gradle dependencies in Eclipse for API Automation with Rest Assured?

 




To perform API Automation with Rest Assured we need add multiple Jars to the Gradle project.

Below is the list of all dependencies required:

  • TestNG
  • Json
  • Extent Report
  • Log4j

Just copy the below part and paste it in build.gradle and all your required dependencies will be added t the project.

Gradle dependencies for Rest Assured Framework Setup:
/*

 * This file was generated by the Gradle 'init' task.

 *

 * This generated file contains a sample Java Library project to get you started.

 * For more details take a look at the Java Libraries chapter in the Gradle

 * User Manual available at https://docs.gradle.org/5.6.1/userguide/java_library_plugin.html

 */

 

plugins {

    // Apply the java-library plugin to add support for Java Library

    id 'java-library'

}

apply plugin: 'maven'

repositories {

    // Use jcenter for resolving dependencies.

    // You can declare any Maven/Ivy/file repository here.

    jcenter()

}

 

dependencies {

    // This dependency is exported to consumers, that is to say found on their compile classpath.

    api 'org.apache.commons:commons-math3:3.6.1'

 

    // This dependency is used internally, and not exposed to consumers on their own compile classpath.

    implementation 'com.google.guava:guava:28.0-jre'

 

    // Use JUnit test framework

    testImplementation 'junit:junit:4.12'

   

    compile 'io.rest-assured:rest-assured:3.0.7'

    compile 'com.google.code.gson:gson:2.2.+'

    compile 'org.testng:testng:6.13.+'

    compile 'commons-io:commons-io:2.4'

    compile group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1'

    compile 'com.relevantcodes:extentreports:2.41.2'

    compile 'log4j:log4j:1.2.17'

       compile 'org.slf4j:slf4j-api:1.7.5'

       compile 'org.slf4j:slf4j-log4j12:1.7.5'

       compile 'commons-logging:commons-logging:1.1.1'

      

}


Check below link for question SET-01:
Top API Interview Question 1-10
 
Check below link for question SET-02:
Top API Interview Question 11-20  
 

For Online Training on SDET contact 9619094122, starting new batch from November First week.  

*************************************************

API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API

 
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes

 
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html

 
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux

 
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign


Java Related Interview Question Set

https://automationreinvented.blogspot.com/search/label/Java


GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT


Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions

 

Want to learn more? ...Check below link for more java interview question:

 

All Time Popular Posts

Most Featured Post

Introduction to Web Testing with Playwright

  Introduction to Web Testing with Playwright 📌  Telegram Group:  https://t.me/+FTf_NPb--GQ2ODhl 📌  YouTube channel:  https://lnkd.in/gGUG...