Good afternoon,
I was wondering if someone can help me out. I will be using Robot Framework quite extensively as part of an upcoming test campaign, and one of the uses will be the testing of a Java Swing application.
Prior to us starting work I need to familiarize myself with the tools enough to be able to provide guidance on the software for new starters.
So far I have managed to get RF demos running on both Windows and Linux. We also have Jenkins running the RF plugin as part of the CI environment. So far, so good.
I have been able to run the Swing Library demos available online, but the problem I am encountering when I try the same with a simple test app I have written is the parent suite setup is failing.
The test app is just a simple GUI with a few text boxes, radio buttons, and a list box on it. My intention being to write a simple test case to insert text, press buttons etc. as a simple example of how it works but I can't get the app to start.
I have written a simple Python script which adds the swinglibrary-1.9.3.jar file to the CLASSPATH, sets the output directory, then initiates the robot framework test:
dir = os.path.dirname(__file__)
swingjar = glob(os.path.join(dir, 'swinglibrary-1.9.3.jar'))
os.environ['CLASSPATH'] = os.pathsep.join(swingjar
call(["jybot", "--outputdir", "results"] + sys.argv[1:], shell=
os.name=='nt')
At the moment I have the distributable 'testapp.jar' file in the same directory as the Python script, robot test file, and the 'swinglibrary.jar' file. The 'testapp.jar' can be run by double clicking, and from the command line with 'java -jar testapp.jar'.
The test app name is defined in the RF test file as:
${testApplicationName} com.iris.testswinggui.TestUI
(the package name as per the Main class followed by the name of the main class)
It is called as part of the Suite Setup under Settings:
Suite Setup Start Test Application
with Start Test Application defined as a Keyword:
Start Test Application
Launch Application ${testApplicationName}
However running this produces the error 'Parent Suite Setup Failed:'. I get no errors about the SwingLibrary.
Is it possible to test the Swing Application like this? or do I need to put the compiled Java class files in a sub directory e.g. 'src\com\iris\testswinggui' and point to them somehow?
Aplogies for my vagueness, I'm not very familiar with Java but if it's possible to test the distributable .jar file like this it would be awesome.
Many thanks in advance for any assistance with this.
Kind Regards,
Adam