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👍👍
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.
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 🙏😇
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 😊
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
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. ..
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 -
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
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
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
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
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?
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 --
@@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.
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
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.
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
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 --
There are not much of the API Automation videos on YT. Thank you for starting this... much needed.. :)
You're very welcome Vinay
You continue to amaze me with your simplicity and way of teaching. Absolutely Brilliant way of teaching.
Thank You Andy.. I will
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👍👍
Glad to know it helped Ankita
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.
Benjamin
please mention the timestamps, so i can refer and check
Best background noise ❤
hope it did not cause any disturbance in learning Himani
Thanks a lot! It really helps me with the installation REST Assured, Maven, and TestNG! Very simple and understandable step-by-step instructions!
Most welcome Ievgenii
Please cover end to end api testing by using BDD sir
Sure
Thank you sir
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 🙏😇
So nice of you Amruta
Thank you so much,pls create a course on core java programming not basic
I agree. I'll look into it Sameer
Thank you so much, it is very useful. Just came and started attracted to rest assured.
Wonderful! Yashwant
Super bro i am able to understand
Great to know Abinesh
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 😊
Thanks Rohit, will add new videos
Great video.👍
Glad you enjoyed it
@@RaghavPal thanks
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
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.
..
Small doubt
we can add testng plugin using Help-> eclipse market place also right.
Yes, you can Yashwant
instead of TestNG can we add BDD cucmber?
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
-
Where will the working set will save? Can I access that?
Thanks for the video.!!
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
@@RaghavPal Got it bro, Thank You
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
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
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 ?
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
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?
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
--
@@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.
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
Basic knowledge of java will help
Very good! Is it possible to make such lesson with Intelij Idea?
Yes, soon
@@RaghavPal Thank a lot! Best wishes!
Not getting the plug-in link for Idea. Thanks
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.
Sir I am getting error. I am not able to install testng plugin
will need to check the error
I have a doubt that will rest work with JAVA SE 15
will need to check on this
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
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
--