REST Assured Beginner Tutorial 3 | How to create Java Project on Eclipse

Поділитися
Вставка
  • Опубліковано 14 гру 2024

КОМЕНТАРІ • 57

  • @sharmavinayrocks
    @sharmavinayrocks 4 роки тому +2

    There are not much of the API Automation videos on YT. Thank you for starting this... much needed.. :)

    • @RaghavPal
      @RaghavPal  4 роки тому

      You're very welcome Vinay

  • @andyrockstar78
    @andyrockstar78 3 місяці тому

    You continue to amaze me with your simplicity and way of teaching. Absolutely Brilliant way of teaching.

    • @RaghavPal
      @RaghavPal  2 місяці тому

      Thank You Andy.. I will

  • @ankitarane8855
    @ankitarane8855 3 роки тому +1

    Thanks Raghav, this video is a blessing..
    It's simple to understand for someone who doesn't'nt understand a lot about API testing...
    Great efforts keep going👍👍

    • @RaghavPal
      @RaghavPal  3 роки тому

      Glad to know it helped Ankita

  • @user-benjaminJohn
    @user-benjaminJohn Рік тому +1

    Hello Raghav, I have two questions regarding this video. Is it necessary to delete the dependency artifact when installing dependencies? I've never seen that done before. Second, When installing the "plugin" for Eclipse, what was the purpose of that plugin? I'm using Intelli-J and got lost in the repo. Thank you.

    • @RaghavPal
      @RaghavPal  Рік тому +1

      Benjamin
      please mention the timestamps, so i can refer and check

  • @himanibhardwaj6636
    @himanibhardwaj6636 3 місяці тому

    Best background noise ❤

    • @RaghavPal
      @RaghavPal  3 місяці тому

      hope it did not cause any disturbance in learning Himani

  • @ievgeniikravtsov1597
    @ievgeniikravtsov1597 3 роки тому

    Thanks a lot! It really helps me with the installation REST Assured, Maven, and TestNG! Very simple and understandable step-by-step instructions!

  • @pandudamera7211
    @pandudamera7211 4 роки тому +3

    Please cover end to end api testing by using BDD sir

  • @amrutajadhav8455
    @amrutajadhav8455 3 роки тому

    Thanks you so much raghav for your efforts....
    While watching ur vedios I feel confident enough ... that I can learn this easly.. 💃💃......
    God bless you 🙏😇

  • @sameerrege8264
    @sameerrege8264 10 днів тому

    Thank you so much,pls create a course on core java programming not basic

    • @RaghavPal
      @RaghavPal  9 днів тому

      I agree. I'll look into it Sameer

  • @yashwantbeeram8543
    @yashwantbeeram8543 3 роки тому

    Thank you so much, it is very useful. Just came and started attracted to rest assured.

  • @abineshkali539
    @abineshkali539 Рік тому

    Super bro i am able to understand

  • @rohitshirbhate6713
    @rohitshirbhate6713 4 роки тому +5

    Thank you so much Raghav, appreciating your efforts 👏
    I was waiting for this REST API tutorials on you tube ✌
    Have gone through this & your language of explanation is very simple & lucid 👍
    Requesting you to cover this tutorial end to end including data driven approach 😊

    • @RaghavPal
      @RaghavPal  4 роки тому +1

      Thanks Rohit, will add new videos

  • @travelfilmandenjoy9581
    @travelfilmandenjoy9581 3 роки тому

    Great video.👍

  • @sravyar4267
    @sravyar4267 9 місяців тому +1

    I created a maven project as you instructed and also tried different solutions but could not find maven dependencies after creating a maven project in eclipse . Could you guide me in resolving this issue

    • @RaghavPal
      @RaghavPal  9 місяців тому

      Sravya
      If you're facing issues with missing Maven dependencies in your Eclipse project, follow these steps to resolve the problem:
      1. Check Maven Configuration:
      - Ensure that you have correctly set up Maven in your Eclipse IDE.
      - Go to Window > Preferences > Maven and verify that the Maven home directory points to the location where Maven is installed.
      2. Update Maven Dependencies:
      - Right-click on your project in the Project Explorer.
      - Choose Maven > Update Project....
      - Select your project and click OK.
      - This action will refresh your project and fetch the Maven dependencies.
      3. Check .classpath File:
      - Open the `.classpath` file at the root of your Eclipse project.
      - Add the following entry to the file:
      ```xml



      ```
      - Save the file and rebuild your project (Project > Clean-Build).
      4. Close and Reopen the Project:
      - Close your project in Eclipse.
      - Reopen the project.
      - Check if the Maven dependencies now appear under the "Maven Dependencies" section in your project.
      5. Verify Maven Nature:
      - Right-click on your project.
      - Go to Configure > Convert to Maven Project.
      - If your project isn't recognized as a Maven project, this step will add the necessary Maven nature.
      6. Check for Typos in pom.xml:
      - Ensure that there are no typos or syntax errors in your `pom.xml` file.
      - Double-check the `` section to make sure all dependencies are correctly specified.
      7. Reimport Maven Projects (if needed):
      - Sometimes Eclipse doesn't recognize changes immediately. Reimport the Maven projects:
      - Right-click on your project.
      - Choose Maven > Update Projects....
      - Select your project and click OK.
      Remember to save your changes and refresh your project after making any modifications.
      ..

  • @yashwantbeeram8543
    @yashwantbeeram8543 3 роки тому

    Small doubt
    we can add testng plugin using Help-> eclipse market place also right.

  • @GaneshVenkat-n8o
    @GaneshVenkat-n8o 2 місяці тому

    instead of TestNG can we add BDD cucmber?

    • @RaghavPal
      @RaghavPal  2 місяці тому

      Yes Ganesh, you can try. In face you can use them together in your project. it's a pretty common combination for API testing. Cucumber helps you write your test scenarios in a way that's easy to understand, even for non-technical folks, while Rest Assured handles the actual API interactions behind the scenes
      -

  • @mallihealth6582
    @mallihealth6582 3 роки тому

    Where will the working set will save? Can I access that?
    Thanks for the video.!!

    • @RaghavPal
      @RaghavPal  3 роки тому +1

      Hi, its all in your workspace, adding a project to a working set and selecting that working set is usually done to
      1. Group similar projects together
      2. Avoid seeing all the projects in the project explorer - to work with focus

    • @mallihealth6582
      @mallihealth6582 3 роки тому

      @@RaghavPal Got it bro, Thank You

  • @bianca121984
    @bianca121984 2 роки тому

    Thank you Raghav.
    Did anyone encounter this error? ..Please help me with your wisdom.
    The method baseURI(String) is undefined for the type RestAssured
    The method when() is undefined for the type String

    • @RaghavPal
      @RaghavPal  2 роки тому +1

      Hi Goka, mostly this is due to import of different library, pls check your import statements and compare with the video
      This can help - stackoverflow.com/questions/41005357/the-method-given-is-undefined-for-the-type-pendingtransactionstest/45662059

  • @AmitChauhan-fv5mf
    @AmitChauhan-fv5mf 2 роки тому

    sir 1 question.
    Why do we need both testNg dependency as well as TestNg as plugin in tool.
    Can't we simply run tests using dependency only ?

    • @RaghavPal
      @RaghavPal  2 роки тому

      Hi Amit, TestNG dependency is needed to use testng functionalities, tags, annotations etc.
      TestNG plugin enables options in IDE, like Run as TestNG test etc

  • @TheNerdGirl123
    @TheNerdGirl123 6 місяців тому

    Hello Raghav, I am following all the steps from your tutorial but for some reason, I am not able to resolve the issue with get(). It shows error "The method get(String) from the type RestAssured referes to the missing type Response." Could you please suggest how to solve this issue?

    • @RaghavPal
      @RaghavPal  6 місяців тому +2

      The error message you're encountering indicates that the `get()` method from the `RestAssured` library is referring to a missing type called `Response`. Let's troubleshoot this issue:
      1. Importing Hamcrest Matchers:
      - The `equalTo` method (used for assertions) is part of the Hamcrest Matchers library.
      - To resolve the issue, make sure you import the `equalTo` method from `org.hamcrest.Matchers` in your test class.
      - Add the following import statement at the beginning of your test class:
      ```java
      import static org.hamcrest.Matchers.*;
      ```
      2. Example Usage:
      - When using `get()` to make an API call, you can assert the response using Hamcrest matchers.
      - Here's an example of how to use `equalTo` with `get()`:
      ```java
      import io.restassured.RestAssured;
      import org.testng.annotations.Test;
      public class MyApiTest {
      @Test
      public void testApiCall() {
      RestAssured.baseURI = "api.example.com"; // Set your API base URL
      // Make the API call
      RestAssured.given()
      .when()
      .get("/my-endpoint")
      .then()
      .assertThat()
      .statusCode(200) // Example: Check if status code is 200
      .body("key", equalTo("expectedValue")); // Example: Check if a specific key has the expected value
      }
      }
      ```
      3. Content-Type Issue (Side Note):
      - If you encounter issues related to content types (e.g., "Unsupported media type"), ensure that you set the correct `Content-Type` header in your request.
      - Use `.contentType("application/json")` to set the content type to JSON if needed.
      Remember to import the necessary classes and use Hamcrest matchers for assertions
      --

    • @TheNerdGirl123
      @TheNerdGirl123 6 місяців тому

      @@RaghavPal Thank you so much for such a detailed answer. I think I created a new method named get from Rest Assured yesterday during troubleshooting (I hovered over the error and tried to fix it with the given options, it automatically created the method). I deleted the file now which seems like working. Appreciate your reply, Raghav.

  • @SMallineni
    @SMallineni 2 роки тому

    hi raghav
    i am very new to software
    before starting to learn rest assured do i have to learn java first
    i have some knowledge in postman tool
    plz help me out

    • @RaghavPal
      @RaghavPal  2 роки тому

      Basic knowledge of java will help

  • @tester4044
    @tester4044 4 роки тому

    Very good! Is it possible to make such lesson with Intelij Idea?

    • @RaghavPal
      @RaghavPal  4 роки тому +1

      Yes, soon

    • @tester4044
      @tester4044 4 роки тому

      @@RaghavPal Thank a lot! Best wishes!

  • @vishuu4113
    @vishuu4113 Рік тому

    Not getting the plug-in link for Idea. Thanks

    • @RaghavPal
      @RaghavPal  Рік тому

      Hi Vishnu
      here are the steps on how to add external plugins on IntelliJ IDEA:
      1. Open IntelliJ IDEA.
      2. Click on **File** > **Settings**.
      3. In the **Settings** dialog, click on the **Plugins** tab.
      4. Click on the **Install Plugin from Disk...** button.
      5. Browse to the location of the plugin archive file (ZIP or JAR).
      6. Click on the **Open** button.
      7. The plugin will be installed and enabled.
      Here are some additional things to keep in mind:
      * The plugin archive file must be in ZIP or JAR format.
      * The plugin archive file must be downloaded from a trusted source.
      * You can also install plugins from the **JetBrains Plugin Repository**.
      To install a plugin from the JetBrains Plugin Repository, follow these steps:
      1. In the **Plugins** tab of the **Settings** dialog, click on the **Browse Repositories...** button.
      2. In the **Browse Repositories** dialog, search for the plugin that you want to install.
      3. Click on the **Install** button next to the plugin.
      4. The plugin will be installed and enabled.
      I hope this helps! Let me know if you have any other questions.

  • @tkishore1260
    @tkishore1260 2 роки тому

    Sir I am getting error. I am not able to install testng plugin

    • @RaghavPal
      @RaghavPal  2 роки тому

      will need to check the error

  • @satyakirankoduru
    @satyakirankoduru 3 роки тому

    I have a doubt that will rest work with JAVA SE 15

    • @RaghavPal
      @RaghavPal  3 роки тому

      will need to check on this

  • @cswithalokkumar9566
    @cswithalokkumar9566 6 місяців тому

    Hello Raghav,
    I am following the same process but getting an error when testNG added.
    Please guide, How to resove this exception "NosuchFieldError ".
    Exception in thread main Java. Lang.NoSuchFieldError: class org.testng.CommandLineArgs does not have member field 'java.lang.Integer port' at org. Testing.remote.remoteTestNG.main

    • @RaghavPal
      @RaghavPal  6 місяців тому

      Alok
      The `java.lang.NoSuchFieldError` occurs when a class tries to access a field that doesn't exist in the referenced library or version. Let's troubleshoot this issue:
      1. Dependency Issue:
      - It seems like a dependency issue. Check if you have conflicting versions of libraries in your project.
      - Specifically, the error message mentions `DEF_CONTENT_CHARSET`, which is related to the `httpcore` library.
      - Ensure that you have the correct version of `httpcore` in your classpath. The minimal requirement is usually `4.4.x`.
      - If you're using Maven, update your `pom.xml` to include the correct version of `httpcore`.
      2. Clean and Compile:
      - Sometimes, outdated compiled files can cause such errors.
      - Clean and compile your project using the `javac` command or by running `mvn clean install` if you're using Maven.
      - This step ensures that you have the latest compiled files and avoids running into the error
      3. Check TestNG Configuration:
      - Verify your TestNG configuration.
      - Ensure that the `CommandLineArgs` class has the expected fields, including the `port` field.
      - If necessary, update your TestNG configuration or dependencies.
      Remember to check your project's dependencies, clean and compile, and verify your TestNG configuration
      --