Re: How to install and use Selenium RC

13 views
Skip to first unread message

mahi002

unread,
Mar 12, 2009, 7:28:46 AM3/12/09
to selenium-users...@googlegroups.com
Hi Pavan,

We want to know whether the following scenario can be tested with Selenium:

Input Data from text file should be fed to 5 different websites at the same time and compare the results displayed on all the sites

For this, I tried to install Selenium RC

I have followed what u have detailed for creation of .bat files, .html files. I saved them on desktop and tried to run Selenium RC on IE  by double clicking on  *SeleniumIE.bat* but got below error:
Even I tried saving these files in c drive but got same error. Please suggest me.......
*\\ C:\>cd\
C:\>cd C:\selenium-remote-control-1.0-SNAPSHOT\selenium-server-1.0-SNAPSHOT
C:\selenium-remote-control-1.0-SNAPSHOT\selenium-server-1.0-SNAPSHOT>java -jar selenium-server.jar -port 4545  -htmlSuite *iehta [http://www.google.com.au] C:\selenium\G_alltestsie.html C:\selenium\Results.html\\ Exception in thread "main" java.lang.UnsupportedClassVersionError: org/openqa/selenium/server/SeleniumServer (Unsupported major.minor version 49.0)\\         at java.lang.ClassLoader.defineClass0(Native Method)\\         at java.lang.ClassLoader.defineClass(Unknown Source)\\         at java.security.SecureClassLoader.defineClass(Unknown Source)\\         at java.net.URLClassLoader.defineClass(Unknown Source)\\         at java.net.URLClassLoader.access$100(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)\\         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
C:\selenium-remote-control-1.0-SNAPSHOT\selenium-server-1.0-SNAPSHOT>pause\\ Press any key to continue . . .



Below is my SeleniumIE.bat file content:

cd\\\ cd C:\selenium-remote-control-1.0-SNAPSHOT\selenium-server-1.0-SNAPSHOT\\ java -jar selenium-server.jar -port 4545  -htmlSuite *iehta [http://www.google.com.au] C:\selenium\G_alltestsie.html C:\selenium\Results.html\\ pause

*

*SeleniumFirefox.bat content:*
cd\\\ cd C:\selenium-remote-control-1.0-SNAPSHOT\selenium-server-1.0-SNAPSHOT\\ java -jar selenium-server.jar -port 4545 -firefoxProfileTemplate C:\Firefoxselenium -htmlSuite chrome [http://www.yourtestwebsite.com//] C:\selenium\G_alltestff.html* C:\selenium\*Results.html*\\ pause

Created G_alltestff.html file as below

<html>\\ <head>\\ <meta content="text/html; charset=ISO-8859-1"\\ http-equiv="content-type">\\ <title>Test Suite</title>\\ </head>\\ <table id="suiteTable"&nbsp;&nbsp;&nbsp; cellpadding="1"\\ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cellspacing="1"\\ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; border="1"\\ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class="selenium">\\ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <tbody>\\ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <tr><td><b>Test Suite</b></td></tr>\\ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <tr><td><a href=".\Tests\Name of you selenium script.html">Name of the Script</a></td></tr>\\ &nbsp;&nbsp;&nbsp; </tbody>\\ &nbsp; </table>\\ </body>\\ </html>

Created G_alltestie.html file as below

<html>\\ <head>\\ <meta content="text/html; charset=ISO-8859-1"\\ http-equiv="content-type">\\ <title>Test Suite</title>\\ </head>\\ <table id="suiteTable"&nbsp;&nbsp;&nbsp; cellpadding="1"\\ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cellspacing="1"\\ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; border="1"\\ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class="selenium">\\ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <tbody>\\ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <tr><td><b>Test Suite</b></td></tr>\\ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <tr><td><a href="C:\Selenium\Tests\Name of you selenium script.html">Name of the Script</a></td></tr>\\ &nbsp;&nbsp;&nbsp; </tbody>\\ &nbsp; </table>\\ </body>\\ </html>

Tried with both browsers but didn't work...



Thanks in advance,
Mahesh

Pavandeep Puddupakkam

unread,
Mar 12, 2009, 6:12:36 PM3/12/09
to selenium-users...@googlegroups.com
Hi Mahesh,

&nbsp; I would suggest that you cmd prompt and check if the java version installed.

c:\> java -version

I think that the java version or the path of the JDK is not correctly specified. Let me know if you still have any problem.

*set JAVA_HOME=C:\Program Files\Java \jdk1.5.0_16 (This is only an example)*


Cheers
Pavandeep

Pavandeep Puddupakkam

unread,
Mar 12, 2009, 6:36:49 PM3/12/09
to selenium-users...@googlegroups.com
If you are planning to run the script to 5 different websites prepare the .bat file as under.

cd\\\ cd C:\selenium-remote-control-1.0-SNAPSHOT\selenium-server-1.0-SNAPSHOT\\ java -jar selenium-server.jar -port 4545 -firefoxProfileTemplate C:\Firefoxselenium -htmlSuite *chrome http://website1.com/ C:\selenium\userscript.html C:\selenium\Result1.html\\ java -jar selenium-server.jar -port 4545 -firefoxProfileTemplate C:\Firefoxselenium -htmlSuite *chrome http://website2.com/ C:\selenium\userscript.html C:\selenium\Result2.html\\ java -jar selenium-server.jar -port 4545 -firefoxProfileTemplate C:\Firefoxselenium -htmlSuite *chrome http://website3.com/ C:\selenium\userscript.html C:\selenium\Result3.html\\ java -jar selenium-server.jar -port 4545 -firefoxProfileTemplate C:\Firefoxselenium -htmlSuite *chrome http://website4.com/ C:\selenium\userscript.html C:\selenium\Result4.html\\ java -jar selenium-server.jar -port 4545 -firefoxProfileTemplate C:\Firefoxselenium -htmlSuite *chrome http://website5.com/ C:\selenium\userscript.html C:\selenium\Result5.html\\ pause

mahi002

unread,
Mar 13, 2009, 7:00:54 AM3/13/09
to selenium-users...@googlegroups.com
Hi Pavan,

Thanks for ur suggestion. After setting the JDK path I am able to overcome the error.
By running SeleniumIE.bat file, I could get 2 browsers of which one has test runner. But again I am unable to proceed from there. Test Runner shows 0 tests run.

Do I need to generate test script manually and paste into C:\Selenium\Tests or any option to do that so as to continue??

Cmd prompt shows as below:
\\ C:\>cd\
C:\>cd C:\selenium-remote-control-1.0-SNAPSHOT\selenium-server-1.0-SNAPSHOT
C:\selenium-remote-control-1.0-SNAPSHOT\selenium-server-1.0-SNAPSHOT>java -jar selenium-server.jar -port 4545&nbsp; -htmlSuite *iehta [http://http://www.google.com.au]C:\selenium\G_alltestsie.html C:\selenium\Results.html\\ 16:19:47.517 INFO - Java: Sun Microsystems Inc. 11.2-b01\\ 16:19:47.517 INFO - OS: Windows XP 5.1 x86\\ 16:19:47.517 INFO - v1.0-SNAPSHOT [1123], with Core v1.0-SNAPSHOT [2182]\\ 16:19:47.611 INFO - Version Jetty/5.1.x\\ 16:19:47.611 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]\\ 16:19:47.626 INFO - Started HttpContext[/selenium-server,/selenium-server]\\ 16:19:47.626 INFO - Started HttpContext[/,/]\\ 16:19:47.642 INFO - Started SocketListener on 0.0.0.0:4545\\ 16:19:47.642 INFO - Started [org.mortbay.jetty.Server@109a4c]\\ 16:19:47.752 WARN - It looks like your baseUrl ([http://http://www.google.com.au]) is pointing to a file, not a directory (it doesn't end with a /).&nbsp; We're going to have to strip off the last part of the pathname.\\ 16:19:48.252 INFO - Launching Embedded Internet Explorer...\\ 16:19:49.284 INFO - Launching Internet Explorer HTA...\\ 16:19:52.879 INFO - Checking Resource aliases

Please suggest...

Thanks,
Mahesh

Pavandeep Puddupakkam

unread,
Mar 15, 2009, 6:25:31 PM3/15/09
to selenium-users...@googlegroups.com
Hi Mahesh,

&nbsp; There is a problem with your .bat file.

C:\selenium-remote-control-1.0-SNAPSHOT\selenium-server-1.0-SNAPSHOT>java -jar selenium-server.jar -port 4545&nbsp; -htmlSuite *iehta [http://http://www.google.com.au|http://http//www.google.com.au] C:\selenium\G_alltestsie.html C:\selenium\Results.html
\\ Change it to
C:\selenium-remote-control-1.0-SNAPSHOT\selenium-server-1.0-SNAPSHOT>java -jar selenium-server.jar -port 4545&nbsp; -htmlSuite *iehta [http://www.google.com.au|http://http//www.google.com.au] C:\selenium\G_alltestsie.html C:\selenium\Results.html

There were two http:// in the batch file.

Make the change and it should work.

Cheers
Pavan

mahi002

unread,
Mar 16, 2009, 6:18:40 AM3/16/09
to selenium-users...@googlegroups.com
Hi Pavan,

Sorry for that....I edited it wrongly with http twice. But even after correcting it to below, it stops after getting browsers one with test runner showing 0 tests run & other with selenium page but not with google page.

cd\\\ cd C:\selenium-remote-control-1.0-SNAPSHOT\selenium-server-1.0-SNAPSHOT\\ java -jar selenium-server.jar -port 4545&nbsp; -htmlSuite *iehta [http://www.google.com.au/]C:\selenium\G_alltestsie.html C:\selenium\Results.html\\ pause

When I click View DOM btn in test runner, it shows error page as
h3. DOM Viewer
This page is generated using JavaScript. If you see this text, your browser doesn't support JavaScript.

I dont know what is happening around...

Reply all
Reply to author
Forward
0 new messages