SwingLibrary
SwingLibrary copied to clipboard
Swing Library Keywords are not displaying in RIDE
Hi , I have downloaded the SwingLibrary1.02 and also added it to ClassPath but RIDE is not showing any Swing Keywords. I was reading on robotframework website that i have to create spec file for Java libraries.
Could you please let me know how to create Spec file for Swinglibrary.
I need help.
Creating library specs for RIDE is discussed here: http://code.google.com/p/robotframework-ride/wiki/KeywordCompletion
I think we should make SwingLibrary's spec available here on downloads, though.
Thanks for the URL. It would be great if you make SwingLibrary spec file and make it available to download for others.
I don't think it will take more of your time to do that , kindly do that.
Thanks , looking forward to spec file in download area.
Hi, I have tried to create spec/xml file for swinglibrary-1.2 but command prompt is displaying error message
I have following settings on my machine: Python Installation : C:\Python27 Jython Installation : C:\jython2.5.2 LibDoc Version 2.6.1 File : C:\libdoc.py
Robotframework: C:\Python27\Lib\site-packages\robot
On command prompt i am sending two commands.
C:>set CLASSPATH=C:\Program Files\Java\jdk1.7.0\lib\tools.jar:swinglibrary-1.2.jar
C:>jython -Dpython.path=C:\Python27\Lib\site-packages/ libdoc.py -f xml SwingLibrary
Following error message appears
Importing test library 'SwingLibrary' failed: ImportError: No module named SwingLibrary
I enhanced our build process to also produce the Spec file for RIDE.
I uploaded Spec for 1.2 in the Downloads section.
Just unzip the file, and make sure that the directory containing SwingLibrary.xml is in the PYTHONPATH when RIDE runs
Thanks for the XML. It is working now.
Good to hear.
FAILS testing Swinglibray demo on RIDE
STEEPs
1.Install RIDE 1.1
2.Load Test Swinglibrary Demo
The ERROR LOGG
Demo1.Example | FAIL | Suite setup failed: No keyword with name 'Start Application' found.
2 critical tests, 0 passed, 2 failed
2 tests total, 0 passed, 2 failed
Demo1 | FAIL | 2 critical tests, 0 passed, 2 failed
2 tests total, 0 passed, 2 failed
Output: c:\windows\temp\RIDExpkebb.d\output.xml
[ ERROR ] Error in file 'C:\roboframework\Python27\SwingLibrary-master\demo1\example.txt' in table 'Settings': Importing test library 'SwingLibrary' failed: ImportError: No module named SwingLibrary Traceback (most recent call last): None
I too have been strugling to get RIDE fully working with SwingLibrary projects. Maybe a better documentation should be writen.
This is what I have found: To have the keywords documented in RIDE we the SwingLibrary.xml must be found by RIDE. This spec file MUST be renamed to SwingLibrary.xml loosing the version suffix.
These projects must be run with Jython (or jybot). To execute SwingLibrary projects from RIDE, the CLASSPATH must have all required .jar files including the application under test and swinglibrary-1.5.3.jar. It is not clear if the JYTHONPATH must point to the folder where .jar exist.
To run project from RIDE, since the environment vars must be set, we cannot use jybot, but run a custom script (in Windows .bat). This is an execution from Command Window: C:\ROBOT\swinglibrary-demo>set CLASSPATH=C:\ROBOT\swinglibrary-demo\lib\swinglibrary-1.5.3.jar
C:\ROBOT\swinglibrary-demo> C:\jython2.5.3\jybot C:\ROBOT\swinglibrary-demo\example.txt
Example
Test Add Todo Item | PASS |
Test Delete Todo Item | PASS |
Example | PASS | 2 critical tests, 2 passed, 0 failed
2 tests total, 2 passed, 0 failed
Output: C:\ROBOT\swinglibrary-demo\output.xml Log: C:\ROBOT\swinglibrary-demo\log.html Report: C:\ROBOT\swinglibrary-demo\report.html
I have attempted with jybot from RIDE but without success.
But using a custom script whe can execute the test and then look at report outside RIDE. This is a functional example: C:\ROBOT\swinglibrary-demo\run_demo.bat content: C:\ROBOT\swinglibrary-demo\run_demo.py C:\ROBOT\swinglibrary-demo\example.txt
We should enhance getting started documentation to explain how to take SwingLib into use in RIDE. In addition to explaining using specs, should also explain that tests must be run with Jython.
Should also consider could RIDE handle specs with version in them automatically or should we perhaps drop the version from the distributed specs. We could just have the latest spec in the source repository (would automatically have all versions available under tags) or possibly under wiki. Library version is visible inside the spec so having it in the file name isn't mandatory.
In short we need to: Ensure that SwingLibrary.xml is always found by RIDE (if simple and not problematic drop version from filename). Instruct users that even if keywords are found/documented in RIDE the test execution must be done with jython (this exist but not near RIDE documentation).
Secondarily: (My wish would be to have all required options set when selecting execution from RIDE, and getting proper report and logs in HTML) Let's say we have a template where the class under test must be defined and dependencies packages.