0

Well I've had a heck of a time getting scheduling working in Intellij Idea. Unfortunately most responses to similar questions refer to Eclipse. Also I have tried command line to no avail with 'can not find class in classpath' issues possibly a TestNG bug. I need hourly scheduling. Suggestions?

BTW I have considered Maven, it's plugin is included with Idea. But it requires a project to be built 'as Maven' from the start, which mine was not. Wonder if my non-Maven project will just import into Maven. Or if there is another better approach to getting hourly test runs with TestNG.

Edit: The command line issue: TestNG, Intellij IDEA, Command Line Test Run Error: Cannot Find Class in Classpath

Thanks!

Community
  • 1
  • 1
M_Tech
  • 330
  • 2
  • 7
  • 16
  • Maybe I should change the name to 'Scheduled Execution of *Anything* in Intellij Idea". All I'm really looking for is Push The Green Go Button, a few times a day... Kind of amazed Intellij didn't build something in. Anyway, any solution to push the green button automatically much appreciated. BTW, the shortcut is I think CTRL+F10, so maybe the best way is to automate a keyboard command. Haha- laughable, but would theoretically work at least. Thanks! – M_Tech Jul 16 '16 at 09:20
  • Changed title from "Scheduled execution of TestNG in Intellij Idea" to "Scheduled execution of Run Button in Intellij Idea". – M_Tech Jul 16 '16 at 09:37
  • You shouldn't have to rely on IntelliJ for scheduling, look at the command IntelliJ is actually executing when you click Run. It will inevitably be modifying the classpath appropriately. – Alex Jul 16 '16 at 09:44
  • That's an interesting path to follow, but where exactly can I see this command? I believe it is burried inside compiled code. Certainly I don't see a CMD prompt pop up every time I click Run in IDEA... – M_Tech Jul 17 '16 at 14:33

1 Answers1

1

If you look in the Run window you should see the full command that IntelliJ is actually running for you. If will appear in short form, but if you click on it, it will expand to give you the whole command.

IntelliJ Run window

Somewhere in this command you will probably notice a -classpath argument which might be what you were originally having trouble with.

If you take this copy this command and stick it in a .bat/.sh (depending on your platform) you will then be able to use a task scheduler (Task Scheduler, cron, etc.) to achieve your hourly run.

Alex
  • 5,364
  • 9
  • 54
  • 69