Re: How to create reports by using selenium RC with Junit

19 views
Skip to first unread message

shyam sundar

unread,
Sep 11, 2008, 6:58:56 AM9/11/08
to selenium-users...@googlegroups.com
Hi,


I am new to loggingselenium. I am tried using the example given in that site, but it creates log report only for the test cas.


I need log report for test suite. So please help me how to create test suite to generate log report.


Thanks,

shyam sundar

unread,
Sep 11, 2008, 8:06:51 AM9/11/08
to selenium-users...@googlegroups.com
Hi,


Thanks for your reply.
writting my own test runner class which is difficult process...Do you know anyother method to generate log report for test suite....
Give me some alternative way to do so. Otherwise i have to run each & every test cases manually & generate report for each one.....


So please guide me


Thanks,

shyam sundar

unread,
Sep 11, 2008, 9:48:30 AM9/11/08
to selenium-users...@googlegroups.com
I am using eclipse & Junit.

Since i cant able to run the selenium testsuite, i am just using junit test suite. This ll run each test case separately and i am trying to do so.


Here is my test suite

import junit.framework.Test;\\ import junit.framework.TestCase;\\ import junit.framework.TestSuite;\\ import com.EvalinvalidUser;\\ import com.Evalowner;\\ import com.Evaluser;\\ import com.ManageAssignments;\\ import com.OwnerHeymath;\\ \\ \\ public class AllTests {\\ \\ @SuppressWarnings("unchecked")\\ public static Test suite() {\\ TestSuite suite = new TestSuite("Test for default package");\\ //$JUnit-BEGIN$\\ suite.addTestSuite((Class<? extends TestCase>) Evaluser.class);\\ suite.addTestSuite((Class<? extends TestCase>) EvalinvalidUser.class);\\ suite.addTestSuite((Class<? extends TestCase>) OwnerHeymath.class);\\ suite.addTestSuite((Class<? extends TestCase>) Evalowner.class);\\ suite.addTestSuite((Class<? extends TestCase>) ManageAssignments.class);\\ //$JUnit-END$\\ \\ return suite;\\ }\\ \\ }\\

in this test suite each class file is a test case which ll run one after another and it should produce report for each class files but it displays some failure trace and terminates...

so help me please.....

NLord

unread,
Sep 11, 2008, 10:04:01 AM9/11/08
to selenium-users...@googlegroups.com
Do you use JUnit4?

Try

@RunWith(Suite.class)
@Suite.SuiteClasses({
oneTest.class,
twoTest.class,
})
public class AllTest {
}

shyam sundar

unread,
Sep 15, 2008, 8:07:18 AM9/15/08
to selenium-users...@googlegroups.com
hi,

Thanks for your suggestion.

Its working but it showing some failure trace so that browser launches and it gets terminated without run the scripts.

This is the trace

junit.framework.AssertionFailedError: No tests found in com.EvalinvalidUser\\ at junit.framework.Assert.fail(Assert.java:47)\\ at junit.framework.TestSuite$1.runTest(TestSuite.java:97)\\ at junit.framework.TestCase.runBare(TestCase.java:134)\\ at junit.framework.TestResult$1.protect(TestResult.java:110)\\ at junit.framework.TestResult.runProtected(TestResult.java:128)\\ at junit.framework.TestResult.run(TestResult.java:113)\\ at junit.framework.TestCase.run(TestCase.java:124)\\ at junit.framework.TestSuite.runTest(TestSuite.java:232)\\ at junit.framework.TestSuite.run(TestSuite.java:227)\\ at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)\\ at org.junit.internal.runners.CompositeRunner.runChildren(CompositeRunner.java:33)\\ at org.junit.runners.Suite.access$000(Suite.java:26)\\ at org.junit.runners.Suite$1.run(Suite.java:93)\\ at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)\\ at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)\\ at org.junit.runners.Suite.run(Suite.java:91)\\ at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)\\ at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)\\ at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)\\ at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)\\ at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)\\ at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)\\ \\

Can you help me? please !!please!!


Thanks,
shyam sundar

Threddy

unread,
Sep 15, 2008, 8:54:56 AM9/15/08
to selenium-users...@googlegroups.com
Hi Shyam,

Depending on how much of a commitment you have made to getting your own test framework sorted you may wish to have a look at a test framework I have developed and recently open sourced.
It is fundamentally a Java/Junit framework accessed through Eclipse and on a Selenium RC platform. So it sounds like a good fit for you.

It allows testers to specifiy tests through data (via spreadsheets) rather than code, but part of the framework also allows you to extend it through Java custom methods.

Please feel to check in out and provide feedback when you get time. Yes it does provide reports - including stack traces and screenshots.

I hope this helps.


http://universaltestframework.blogspot.com/

shyam sundar

unread,
Sep 16, 2008, 3:15:15 AM9/16/08
to selenium-users...@googlegroups.com
Hi kai,

I think you mean the viedo at this site " http://universaltestframework.blogspot.com/ ".
If so then check your browser plug in.Because i can see two videos in that site. You need flash player plugin installed in te browser to see the video.


regards,
Shyam

Threddy

unread,
Sep 16, 2008, 4:28:28 AM9/16/08
to selenium-users...@googlegroups.com
Hi,

This is indeed the case which I have now made clearer. The video now has audio too.
I hope you find it useful.

sannya

unread,
Sep 16, 2008, 8:21:49 AM9/16/08
to selenium-users...@googlegroups.com
Hi,


I am using Testng+selenium RC+ant combination and i use selenium with java language. i tried the above concept for generating report using junit but i didn't get any report in the given directory. Could u please help me for generating the report (Script is in java language).


-Sannu

Threddy

unread,
Sep 16, 2008, 9:31:12 AM9/16/08
to selenium-users...@googlegroups.com
Hi Sannu,

I take it you are neither using Eclipse nor my Universal Test Framework. I would suggest doing both if you are struggling.

However, if you wish to do things your own way heed the following:\\

If you are running your Ant script outside of Eclipse it needs to be made aware junit report directory and your classpath settings.
So for the Universal Test Framework they are set (within the build.xml) to:


<junitreport todir="${junit.report.dir}">\\ <fileset dir="C:/UTF/" includes="*xml" excludes="TESTS-TestSuites.xml" />\\ <report format="${junit.report.format}" styledir="${junit.report.style.dir}" todir="${report.dir}"/>\\ </junitreport>

<path id="project.compile.class.path">\\ <pathelement location="../bin" />\\ <pathelement location="C:/UTF/UniversalTestFramework/Jars/POI/poi-3.1-beta1-20080428.jar" />\\ <pathelement location="C:/UTF/UniversalTestFramework/Jars/POI/poi-3.1-beta2/poi-3.1-beta2-20080526.jar" /> \\ <pathelement location="C:/UTF/UniversalTestFramework/SeleniumClient/Jars/0.92/selenium-java-client-driver.jar" />\\ <pathelement location="C:/UTF/UniversalTestFramework/SeleniumServer/Jars/0.92/selenium-server.jar" />\\ <pathelement location="C:/UTF/eclipse/plugins/org.junit_3.8.1/junit.jar" />\\ <pathelement location="C:/UTF/UniversalTestFramework/Jars/JDBC/ojdc14_g.jar" />\\ <pathelement location="C:/Ant/apache-ant-1.7.0/lib/*" />\\ <pathelement location="C:/Ant/jaf-1.1.1/activation.jar" />\\ </path>\\ \\

I load the build properties via a property file:
<property file="../conf/universalTestFramework.properties" />\\

I would google something like TestNg and Ant for detailed help with this.


Alternatively, I'd check out an execution ready framework that is based on the platform you seem to be using.

Good luck either way!

shyam sundar

unread,
Sep 17, 2008, 2:14:03 AM9/17/08
to selenium-users...@googlegroups.com
hi,


I cant able to get the installation file from "sourceforge ". And also cant able to use the manual of " universal test framework ". So please help me. I need to develop the code for *test suite* in _*eclipse + junit + (any report generation tools)*_. And i need to *built* the script and run it on the command prompt. So can anyone say how to built the eclipse junit project and to run the script in selenium RC directly from *comand prompt* without using eclipse



thanks

shyam sundar

unread,
Sep 17, 2008, 2:55:45 AM9/17/08
to selenium-users...@googlegroups.com
hi

i cant able to install universaltestfr. I saw the manual for installation
It displays,

Error validation Location: "cannot connect to server......."

so how could i install the UTF

Thanks

Threddy

unread,
Sep 17, 2008, 4:40:52 AM9/17/08
to selenium-users...@googlegroups.com
Hi,

When did you get that error - when you downloaded from Scribd?
There is an issue with getting the Universal Test Framework directly from SourceForge at the moment - and they are not being the quickest to help.
However, you don't need to go via the SourceForge download. If you get hold of the manual it will show you how to download directly via CVS. The video on my blog also takes you through these steps.

Get hold of the User Manual and all the instructions are there. I have heard of no issues with Scribd and I know others have downloaded it. Please try again.
The direct link is below:
http://www.scribd.com/full/6037694?access_key=key-1sbnrt4k8lxk142isd6u
The link on the blog is certainly OK at the moment.

You can run Ant from the command line - but you need to tell it where things live as I mentioned earlier.

Thanks for trying the UTF. Best of luck with your endeavours!

Reply all
Reply to author
Forward
0 new messages