Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

How to Run a Selenium IDE Test Case using Selenium RC

View previous topic View next topic Go down

How to Run a Selenium IDE Test Case using Selenium RC

Post by rajareddy on Mon Jun 18, 2012 3:41 pm

Hi,

Is there any videos/Presentations/Documents which explains step by step procedure to run a Selenium IDE test Case using Selenium RC.

Note:

I am a fresher to Selenium and this would be my first test using Selenium RC, and hence I request you to provide me the baby steps please.

Thanks,
Raja Reddy

rajareddy
Active particpant
Active particpant

Posts : 11
Join date : 2012-06-07

Back to top Go down

Re: How to Run a Selenium IDE Test Case using Selenium RC

Post by ccox on Tue Jun 19, 2012 2:09 am

Are you able to get the Selenium server running? That should be your first step.

After you do that, you can run your script from the command line like this:
java -jar selenium-server-standalone.(version number).jar -htmlSuite "*iexplore" "www.google.com" "C:\path to your test suite" "C:\Path to results.html"

ccox
Master
Master

Posts : 205
Join date : 2012-01-06
Age : 31
Location : Denver, CO

Back to top Go down

How to Run a Selenium IDE Test Case using Selenium RC

Post by rajareddy on Tue Jun 19, 2012 6:38 pm

Hi,

I have tried to execute through Selenium RC through Eclipse. But I am getting an error stating

"java.lang.RuntimeException: Could not start Selenium session: Failed to start new browser session: Error while launching browser
at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:89)
at com.core.test_Selenium.setUp(test_Selenium.java:22)
at junit.framework.TestCase.runBare(TestCase.java:132)
at com.thoughtworks.selenium.SeleneseTestCase.runBare(SeleneseTestCase.java:212)
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.OldTestClassRunner.run(OldTestClassRunner.java:76)
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)
Caused by: com.thoughtworks.selenium.SeleniumException: Failed to start new browser session: Error while launching browser
at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)
at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91)
at com.thoughtworks.selenium.HttpCommandProcessor.getString(HttpCommandProcessor.java:262)
at com.thoughtworks.selenium.HttpCommandProcessor.start(HttpCommandProcessor.java:223)
at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:81)
... 16 more". Please find attached the screen shots and kindly help me out of this issue

Thanks,
Raja Reddy

rajareddy
Active particpant
Active particpant

Posts : 11
Join date : 2012-06-07

Back to top Go down

Re: How to Run a Selenium IDE Test Case using Selenium RC

Post by rohit13 on Tue Jun 19, 2012 8:33 pm

As you are using eclipse, export your selenium IDE code to Junit4 RC format.
Get the selenium server from http://seleniumhq.org/download/
Also download java language driver
Open Eclipse
Create New Java Project
Create New Class.
Add Downloaded file as external jars to project.
Start server from command prompt eg - c:/java -jar selenium_server.jar
Now you are ready to execute your script with eclipse

_________________
Radical QA
http://radical-qa.blogspot.in/

rohit13
Master
Master

Posts : 180
Join date : 2012-03-29
Age : 30
Location : INDIA

http://radical-qa.blogspot.in/

Back to top Go down

How to Run a Selenium IDE Test Case using Selenium RC

Post by rajareddy on Wed Jun 20, 2012 1:06 pm

Hi,

I have done the same....

once i did all that, i have started selenium server through "java -jar selenium-server.jar". and then I have executed in the eclipse using "Run as->Java Application". but still I got that error as I mentioned above in the Eclipse. So please help me out of this issue please.

Thanks,
Raja Reddy

rajareddy
Active particpant
Active particpant

Posts : 11
Join date : 2012-06-07

Back to top Go down

Re: How to Run a Selenium IDE Test Case using Selenium RC

Post by SivaNathaPandian on Mon Jun 25, 2012 4:35 pm

Export the Selenese Code in SeleniumIDE... Installed Jar files in Eclips..

Start Selenium-server.jar

Run The Application

SivaNathaPandian

Posts : 1
Join date : 2012-06-25

Back to top Go down

How to Run a Selenium IDE Test Case using Selenium RC

Post by rajareddy on Tue Jun 26, 2012 4:50 pm

Hi,

Thank you Rohit for helping me all the time and thank you sivenathapandian.

I have done the same once again, but still getting the error. So please find the below mentioned codes and help me out of this issue.

( My Objective is I have to export the results to an Excel Sheet and I have to supply the input test data from excel sheet). So please if possible share me a sample working code which satisfies this requirement please.

Eclipse code(Junit4 Selenium RC):

package com.core;
import com.thoughtworks.selenium.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class test_Selenium extends SeleneseTestCase
{
public static void main(String args[])
{
test_Selenium obj = new test_Selenium();
obj.setUp();
obj.testtest_Selenium();
obj.tearDown();
}

@Before
public void setUp()
{
selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.gocurrency.com/");
selenium.start();
}

@Test
public void testtest_Selenium()
{
selenium.open("http://www.gocurrency.com/");
selenium.type("id=inV", "500");
selenium.select("id=from_dd", "label=Utd. Arab Emir. Di");
selenium.select("id=to_dd", "label=Indian Rupee");
selenium.click("id=conv_button");
selenium.waitForPageToLoad("30000");
String a = selenium.getText("//div[@id='converter_results']/ul/li[3]");
System.out.println("value is " + a);
selenium.open("http://www.xe.com/");
selenium.type("id=amount", "500");
selenium.click("id=from_sc");
selenium.click("css=li.ac_even.ac_recent");
selenium.click("id=to_sc");
selenium.click("css=#to_scroller > li.ac_even.ac_recent");
selenium.click("css=input.uccGo");
selenium.waitForPageToLoad("30000");
String b = selenium.getText("css=tr.uccResUnit > td");
System.out.println("value is " + b);
System.out.println(a);
System.out.println(b);
// selenium.gotoIf("storedVars['a']==storedVars['b']", "true");
// selenium.gotolabel("finish");
// selenium.label("true");
// selenium.label("finish");
}

@After
public void tearDown()
{
selenium.stop();
}

}

Selenium IDE code (HTML):

Variable comparision
open http://www.gocurrency.com/
type id=inV 500
select id=from_dd label=Utd. Arab Emir. Di
select id=to_dd label=Indian Rupee
clickAndWait id=conv_button
storeText //div[@id='converter_results']/ul/li[3] a
echo value is ${a}
open http://www.xe.com/
type id=amount 500
click id=from_sc
click css=li.ac_even.ac_recent
click id=to_sc
click css=#to_scroller > li.ac_even.ac_recent
clickAndWait css=input.uccGo
storeText css=tr.uccResUnit > td b
echo value is ${b}
echo ${a}
echo ${b}
gotoIf storedVars['a']==storedVars['b'] true
getEval alert("Not Matching")
gotolabel finish
label true
getEval alert("Matching")
label finish

rajareddy
Active particpant
Active particpant

Posts : 11
Join date : 2012-06-07

Back to top Go down

Re: How to Run a Selenium IDE Test Case using Selenium RC

Post by Sponsored content Today at 1:10 am


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum