0

I need to automate JProfiler GUI (switching between various tabs, extracting textual data and verifying them). I have been trying to use assertj-swing library. However, JProfiler is launched by an executable and not by class file.

Is there a method in assertj Swing to launch a app by its executable?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • JProfiler has a command line export utility "bin/jpexport" that exports most views to HTML/XML/CSV. Could you use that instead? Scraping the data from the GUI will be very difficult. – Ingo Kegel Feb 27 '17 at 13:52
  • Hi Ingo, Thanks for the suggestion. But our main intention is to test the functionality of GUI. – Sriram Nagaraj Mar 01 '17 at 12:57
  • Why do you want to test the JProfiler GUI? This is something we do as part of the release. We actually use assertj-swing to do that. – Ingo Kegel Mar 01 '17 at 15:39
  • We are testing the Jprofiler GUI with a proprietary JVM. According to docs, an application can be invoked by assert-swing if you have a class file. However, i find no class file for invoking Jprofiler GUI (please correct me if i am wrong here) and hence i want to know how to launch it by its executable. – Sriram Nagaraj Mar 02 '17 at 11:47
  • You would have to add bin/jprofiler.jar and all the libraries in the lib directory as well as its subdirectories and invoke com.jprofiler.frontend.FrontendApplication. – Ingo Kegel Mar 02 '17 at 12:26
  • That info was of great help. Thanks Ingo. With respect to the message "Caused by: java.lang.ClassNotFoundException: com.install4j.api.launcher.StartupNotification$Listener" while invoking profiler, I am guessing we have to build and install 'install4j'; I would like to know if there is any simpler work around/alternative i.e., by downloading a jar file (having it including in class path) ? – Sriram Nagaraj Mar 13 '17 at 13:08
  • You just have to include the jar file .install4j/i4jruntime.jar – Ingo Kegel Mar 13 '17 at 13:54
  • Inclusion of the .jar files did clear all the exception. However, on running the program to invoke Jprofiler, my code exits on encountering 'APPLICATION.start();' statement without any message. Snippet of my code: public static String JC_LAUNCH_CLASS = "com.jprofiler.frontend.FrontendApplication"; APPLICATION = ApplicationLauncher.application(JC_LAUNCH_CLASS); APPLICATION.start(); any insights on how to resolve this issue? – Sriram Nagaraj Mar 19 '17 at 08:46
  • Unfortunately I don't have the context to analyze this problem. – Ingo Kegel Mar 19 '17 at 09:06

0 Answers0