# Gradle -\> TestNg -\> How to run TestNg suite from Gradle

**URL:** <https://discuss.gradle.org/t/gradle-testng-how-to-run-testng-suite-from-gradle/23225>\
**Category:** Help/Discuss\
**Created:** [July 7, 2017, 5:14pm UTC](https://discuss.gradle.org/t/gradle-testng-how-to-run-testng-suite-from-gradle/23225 "2017-07-07T17:14:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JagatheswaranSelvaku](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@JagatheswaranSelvaku](https://discuss.gradle.org/u/JagatheswaranSelvaku)\
**Post date:** [July 7, 2017, 5:14pm UTC](https://discuss.gradle.org/t/gradle-testng-how-to-run-testng-suite-from-gradle/23225/1 "2017-07-07T17:14:35Z")

</div>

Hi Frnds,

I am new to Gradle and have Gradle project with TestNg script and I need to run my test thorugh gradle,so could you please help me to run.

Please find My Build.gradle

/\*

- This build 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 guide available at [https://docs.gradle.org/3.5/userguide/java\_library\_plugin.html](https://docs.gradle.org/3.5/userguide/java_library_plugin.html)  
\*/  
apply plugin: 'java’  
apply plugin: ‘maven’

sourceCompatibility = 1.5  
targetCompatibility = 1.5  
tasks.withType(JavaCompile) {  
options.encoding = ‘UTF-8’  
}

repositories {

```
 maven { url "http://repo.maven.apache.org/maven2" }

```

}

dependencies {  
compile group: ‘org.seleniumhq.selenium’, name: ‘selenium-java’, version:'2.52.0’  
compile group: ‘org.seleniumhq.selenium’, name: ‘selenium-server’, version:'2.52.0’  
compile group: ‘info.cukes’, name: ‘cucumber-java’, version:'1.2.2’  
compile group: ‘info.cukes’, name: ‘cucumber-testng’, version:'1.2.4’  
compile group: ‘info.cukes’, name: ‘cucumber-core’, version:'1.2.4’  
compile group: ‘org.hamcrest’, name: ‘hamcrest-all’, version:'1.3’  
compile group: ‘info.cukes’, name: ‘gherkin’, version:'2.12.2’  
compile group: ‘com.google.guava’, name: ‘guava’, version:'18.0’  
testCompile group: ‘org.testng’, name: ‘testng’, version:‘6.8’  
}

test {  
useTestNG() {  
useDefaultListeners = true  
suites ‘src/test/resources/AllTest.xml’  
}  
}
