title: Intellij IDEA Error: Could not find or load main class test
body: <p>I am using IntelliJ IDEA for learning automation testing with <code>Selenium</code> and have write 3/4 maven tests in my TestSuite using <code>TestNG</code> annotations. </p>
  
  <p>Now on <code>Run/Debug</code> Config in <code>VM option</code> If I use command </p>
  
  <pre><code>-Dbrowser="chrome" 
  </code></pre>
  
  <p>run the test suite, it works fine.</p>
  
  <p>But when I need to run a specific test I try giving the command     </p>
  
  <pre><code>-Dtest=TestSuit#testname 
  </code></pre>
  
  <p>to test and run but it gives an erro as </p>
  
  <blockquote>
    <p>Error: Could not find or load main class test.</p>
  </blockquote>
  
  <p>I have already tried deleting target folder and run again.
  Also, java path is already set correctly.</p>
  
  <p><a href="https://i.stack.imgur.com/ffUhc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ffUhc.png" alt="Configurations"></a></p>