It's all about the answers!

Ask a question

RQM and Selenium integration


Marc van Lint (852129) | asked Dec 19 '12, 2:05 p.m.
JAZZ DEVELOPER
Hi Collegues,

With the above integration I get the message:

19:42:13,621 [main]  INFO com.ibm.rqm.adapter.library                        - Successfully created an HTTP client
19:42:13,886 [main]  INFO com.ibm.rqm.adapter.library                        - The adapter is now connected
19:42:14,229 [main]  INFO com.ibm.rqm.adapter.library                        - Resolved project area named "JKE Banking (Quality Management)" to alias: JKE+Banking+%28Quality+Management%29.
19:42:14,697 [main]  INFO com.ibm.rqm.adapter.commandline                    - Created JUnit Selenium Adapter
19:47:21,706 [Thread-2] ERROR com.ibm.rqm.adapter.commandline                    - Failed to read serialized JUnit report object: null  Execution result will not contain step results for individual JUnit tests.

This is produced after the test was started. Meaning I've got a TC, TS and a connected adapter. I also have a class file.
I was wondering also, in the TS I've placed the name of the class-file as test-class, without the .class extention and without any directory in front of it. Class file is located in the 'home' directory of the adapter, where the RQM adapter start.bat is located.

Any idea's?
What other information can I provide?

Thanks,
Marc

3 answers



permanent link
Thomas Neal (141133) | answered Jan 03 '13, 9:46 a.m.
JAZZ DEVELOPER
Hey Marc,

In the Test Class field you should specify the name of the class that runs your JUnit test, ie. something like com.example.tests.AllSeleniumTests. 

What do you have specified in the Classpath field?  It should specify any classpath values required to find all your .class files, ie. something like /home/tneal/workspaces/Selenium/SeleniumJUnit/bin.  If you need to specify multiple components in the classpath be sure to separate them with the correct separator character for the platform where the JUnit Selenium adapter is running.  ie. ';' for Windows and ':' for Linux/Unix.

Did you get any errors/messages in the execution result that give more info about the failure?

--tom

permanent link
Marc van Lint (852129) | answered Jan 04 '13, 10:23 a.m.
JAZZ DEVELOPER
I think I'm a few steps further.

I restarted investigation with:
http://www.ibm.com/developerworks/rational/library/run-automated-selenium-junit-tests/index.html

What's possible:
- Run script from the Browser - Oke
- Run script from Eclipse IDE as JUNIT - Oke
- Start Adapter - Oke
- Start script from RQM - not oke

In the RQM Selenium adapter window I get:


C:\Selenium\RQMJUnitSeleniumAdapter>./start.bat -repository  https://fibula5.van
lint5.nl:9443/qm -user clmadmin -password clmadmin -adapterName SeleniumAdapter
-projectArea "JKE Banking (Quality Management)"
Launching Command Line Adapter...

java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)
Adapter is reconnecting. Using saved configuration information from Config2.ini
java.security.NoSuchAlgorithmException: SSL_TLS SSLContext not available
Unable to create SSL_TLS context, trying TLS
Successfully created an HTTP client
java.security.NoSuchAlgorithmException: SSL_TLS SSLContext not available
Unable to create SSL_TLS context, trying TLS
The adapter is now connected
Resolved project area named "JKE Banking (Quality Management)" to alias: JKE+Ban
king+%28Quality+Management%29.
Created JUnit Selenium Adapter
Monitor Progress: [C:\Users\IBM_AD~1\AppData\Local\Temp\QMAdapter828460061396051
0008.execprop]
ExitCode: 1

In the trace error file I get:

java.lang.NoClassDefFoundError: org/junit/runner/notification/RunListener
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    at java.lang.Class.getMethod0(Unknown Source)
    at java.lang.Class.getMethod(Unknown Source)
    at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
    at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.junit.runner.notification.RunListener
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 6 more
Exception in thread "main"
Failed to read serialized JUnit report object: null  Execution result will not c
ontain step results for individual JUnit tests.

Comments
Marc van Lint commented Jan 04 '13, 10:30 a.m.
JAZZ DEVELOPER

BTW Above is not an answer ...


Marc van Lint commented Jan 04 '13, 10:45 a.m.
JAZZ DEVELOPER

Oke now it's gets interesting: if I add the long-list-of-jar-files in the classpath definition of the RQM-script, than it works... Any other way it fails....


Thomas Neal commented Jan 04 '13, 11:06 a.m.
JAZZ DEVELOPER

Marc,

If adding classpath info to the script fixes the problem, it sounds like you may not have the seleniumClasspath property set correctly. 

Check the selenium.properties file found in the JUnit Selenium adapter directory, does the com.ibm.rqm.selenium.seleniumClasspath property include all the classpath values required to run a Selenium test?  Does it use the correct separator character?  ie. semi-colon for Windows and colon for Linux.  Are all the values specified on one line?


permanent link
Marc van Lint (852129) | answered Jan 04 '13, 11:59 a.m.
JAZZ DEVELOPER
Yes - the final answer.. :-)
Use the manual, use the developerWorks article.

Most important the dir command piped to a file gives \ characters. The characters to use in the properties file is / . A piece of the correct working properties file is:

# All classpath entries required to execute a Selenium WebDriver JUnit testcase. 
# This must be set before any Selenium tests can be executed by the adapter.
# Be certain to use the correct separator character for the platform running this
# adapter.  ie. ';' for Windows and ':' for Linux
com.ibm.rqm.selenium.seleniumClasspath=C:/Selenium/selenium-java-2.28.0/selenium-2.28.0/libs/apache-m....

Now can every Selenium user make use of a great Rational Test Management environment!

Thanks Neal.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.