Are you using IntelliJ IDEA? I have this problem as well when using
that IDE. I'm not sure about other IDEs.
Here's the fix for IDEA:
1. Go to: File>Project Structure
2. Under Project Settings select, "Libraries"
3. In the middle pane, select "lib"
4. In the right pane, select, "Attach Jar Directories..."
5. Select, "<Program Files>\JetBrains\IntelliJ IDEA Community Edition
<version>\plugins\testng\lib"
6. Done!
If you're using something else, there should be a similar way to add a
dependency. Ask and I'll see if I can help.
Cheers,
Erek