IntelliJ "No Tasks Available" on running TestNG

I have setup a project with TestNG and when I try to run the test class or test method from the context menu "Run [TestClassName]" I am seeing "No Tasks Available" on the context pop-up.

How can I make the test run or what is the configuration I am missing?

I am using IntelliJ 2019.2.

No Tasks Available]


When I had this problem ("No tasks available" message when trying to run a test), what worked for me was to Re-import the project from the Gradle view (i.e. in the Gradle view, right-click on the project containing the test and select "Reimport Gradle Project").


Seems to be an configuration issue in Intellij, Please check the test runner you have selected under the IntelliJ Build settings. check out the following thread and go to the last comment https://intellij-support.jetbrains.com/hc/en-us/community/posts/207307465-IntelliJ-can-t-run-unit-tests-in-hierarchical-gradle-project-