Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
zea
Posts : 7
Join date : 2009-09-26

How to start SeleniumRC in Java IDE? Empty How to start SeleniumRC in Java IDE?

Sat Sep 26, 2009 11:58 am
Hello,

How to start SeleniumRC in Java IDE? Icon_eek I have trouble to run my test with NetBean as below:

public class MercuryTourTest extends SeleneseTestCase {
public static void main (String [] Args)throws Exception{
TestRunner.run(new MercuryTourTest());
}
}

I got the error:
1) MercuryTourTest(com.core.testscripts.MercuryTourTest)junit.framework.AssertionFailedError: TestCase.fName cannot be null
at com.thoughtworks.selenium.SeleneseTestCase.runBare(SeleneseTestCase.java:212)
at com.core.testscripts.MercuryTourTest.main(MercuryTourTest.java:40)

Can anybody please help me with it?

What do you use in main to start your testXXX method?

If using below instead of TestRunner.run(new MercuryTourTest()), it would work.

MercuryTour obj = new MercuryTour();
obj.setUp();
obj.testMercuryTour();

Thanks,

Zea
Advisor
Advisor
------------------------
------------------------
Posts : 387
Join date : 2009-07-30
Location : India
https://seleniumforum.forumotion.net

How to start SeleniumRC in Java IDE? Empty Re: How to start SeleniumRC in Java IDE?

Sun Sep 27, 2009 10:25 pm
Hi,

To start RC through java IDE you have tofirst link your selenium-java jar and junit to your project folder. Next your selenium server must be started before executing code.

I have one simple code created on google site and it is easy to understand and working fine.

Snnipet of code:

import com.thoughtworks.selenium.*;

public class testElementProperty
{
private Selenium browser;


public static void main(String args[])
{
testElementProperty obj = new testElementProperty();
obj.setUp();
}



public void setUp()
{
browser = new DefaultSelenium("localhost",4444,"*chrome", "http://www.google.co.in/");
browser.start();
browser.open("http://www.google.co.in/");
browser.type("q", "selenium rc");
browser.click("btnG");


}


}


Try this and you will get some hint to regarding your problem. Best of luck.

Bye
avatar
zea
Posts : 7
Join date : 2009-09-26

How to start SeleniumRC in Java IDE? Empty Re: How to start SeleniumRC in Java IDE?

Sat Oct 03, 2009 11:49 am
Hi,

Thanks a lot for the above code and it works with Java IDE running as a Java application.

Suppose I want to use the same code to set up Selenium RC with TestNG so I can use TestNG's flexibility. I have read TestNG's documentation and tried some pure testNG class, but I had trouble to set up the above simple steps with testNG...

Please help me and thank you,

Zea
avatar
zea
Posts : 7
Join date : 2009-09-26

How to start SeleniumRC in Java IDE? Empty Re: How to start SeleniumRC in Java IDE?

Sat Oct 03, 2009 12:36 pm
Hi all,

I just made it working.

from Selelium IDE export as Java TestNG, I got my test class with only one method as below:

package com.example.tests;

import com.thoughtworks.selenium.*;
import org.testng.annotations.*;
import static org.testng.Assert.*;
import java.util.regex.Pattern;

public class GoogleTest extends SeleneseTestNgHelper {

@Test public void testGoogle () throws Exception {

selenium.selectWindow("name=null");
browser.type("q", "selenium rc");
browser.click("btnG");

}

In Eclipse, I needed to modify the above a little:

public class Tour_NG extends SeleneseTestNgHelper {

private Selenium browser;

@Test public void testTour_NG() throws Exception {

browser = new DefaultSelenium("localhost",4444,"*chrome", "http://www.google.com/");
browser.start();
browser.open("http://www.google.com/");
browser.type("q", "selenium rc");
browser.click("btnG");

}

and configured a testNG run configuration and ran it successfully. It was simple and I got a nice report set in the file system under the test directory.

A big thanks to Adviser for your tips!

Zea
avatar
uma maheswari
Active particpant
Active particpant
Posts : 12
Join date : 2010-10-19

How to start SeleniumRC in Java IDE? Empty Re: How to start SeleniumRC in Java IDE?

Fri Oct 22, 2010 2:02 pm
hi,
-This is uma.
-i am new in this selenium tools.
-I use selenium rc in java language-Eclipse sdk.
-i try to run the test suite using selenium commands.
-But i dont know exactly use of command other than the command open,click.waitforpagetoload,type,select,assertTextPresent,verifyTextPresent,storeTextPresent,assertElementPresent.....
-can any one send me the sample that how to use the selenium commands to run the test suites.

Sponsored content

How to start SeleniumRC in Java IDE? Empty Re: How to start SeleniumRC in Java IDE?

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