How to use TestNG in Idea?

I'm using Idea 8.1 and TestNG 5.8.

I don't know how run testng in Idea. I found this place http://www.jetbrains.com/idea/features/junit_testng.html, but it doesn't help much. I'd like to be able to run testng as easily as junit (right click on the tab and choose run). Is that possible? If yes, could anybody tell me how?

Regards.

0
6 comments
Avatar
Permanently deleted user

It works the same way with TestNG. Do you have TestNG plugin installed ?

0
Avatar
Permanently deleted user

Yes, I do. I can see a symbol on the editor tab for a test class (that symbol looks like the one for junit test class). When I right-clicked the tab editor, I don't see any item to run this test class!

I have attached an image for you to see.



Attachment(s):
untitled.png
0
Avatar
Permanently deleted user

I see. You are right. This must be a bug. I usually invoke tests from browser tab and there right-click works fine for both JUnit and TestNG.

Maybe you should create a Jira ticket if there isn't one already.

Cheers,
d.

0
Avatar
Permanently deleted user

By the way, do I need a testng.xml file? If yes, how can I tell Idea about that testng.xml?

0
Avatar
Permanently deleted user

No you don't need testng.xml but you can run whole test suite if you have one. Create TestNG run task (Run/Debug Configuration) and select Suite. See screenshot.



Attachment(s):
TestNGSuite.png
0
Avatar
Permanently deleted user

Hello,

You've invoked popup menu on the editor tab. JUnit doesn't work there either.
PLease right click in editor on the class or method to run.

Thank you

-


Anna Kozlova
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

Yes, I do. I can see a symbol on the editor tab for a test class (that
symbol looks like the one for junit test class). When I right-clicked
the tab editor, I don't see any item to run this test class!

I have attached an image for you to see.

---
Original message URL:
http://www.jetbrains.net/devnet/message/5232512#5232512



0

Please sign in to leave a comment.