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
dbekkerman
Posts : 2
Join date : 2010-01-29

can't make RC code to run Empty can't make RC code to run

Fri Jan 29, 2010 7:01 am
I am not sure I have build in all the jar files into lib directory that requires, but when I try to run even the simplest code below I get error messages

Multiple markers at this line
- The hierarchy of the type NewTest is inconsistent
- The type junit.framework.TestCase cannot be resolved. It is indirectly referenced from
required .class files


Here is my code below. What am I missing ? Please help. Thank you

package com;

import com.thoughtworks.selenium.*;
import java.util.regex.Pattern;

public class NewTest extends SeleneseTestCase
{
public static void main(String args[])
{
NewTest nt = new NewTest();
nt.setUp();
nt.testNew();
}

public void setUp() throws Exception
{
setUp("http://www.google.com/", "*firefox");
}
public void testNew() throws Exception
{
selenium.open("/");
selenium.type("q", "selenium rc");
selenium.click("btnG");
selenium.waitForPageToLoad("30000");
}

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

can't make RC code to run Empty Re: can't make RC code to run

Fri Jan 29, 2010 11:31 am
Hi,

First try to remove package from your code . just write in a simple one class file.Don't use package concept.

You have to take setUp() and testNew() method out of main class block also.

You have to link 2 jar file to your project in your IDE or editor you are using to write code.
1. Junit.jar
2. selenium-java-client-driver.jar

You have to start selenium server also before executing the code.Finally run your code and I'm sure it will be execute.


Hope this will help you. Best of luck.

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

can't make RC code to run Empty Re: can't make RC code to run

Fri Jan 29, 2010 11:38 am
avatar
dbekkerman
Posts : 2
Join date : 2010-01-29

can't make RC code to run Empty Re: can't make RC code to run

Sat Jan 30, 2010 6:23 am
Hi Adviser.

The reason it did not work b/c I I did not build in JUnit.jar - just so others beware to download it from junit.org and add to Reference Libraries along with selenium-java-client-driver.jar

Now it is working can't make RC code to run Icon_smile ... gosh I spent 3 freaking days trying to make it run

Thank you !!!
avatar
mjd2010
Posts : 2
Join date : 2010-05-04

can't make RC code to run Empty Re: can't make RC code to run

Wed May 05, 2010 12:09 am
Hi, I have associated junit-4.8.1.jar and selenium-java-client-driver.jar files. Still I see the below issue.

java.lang.NoSuchMethodError: main
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:C:\PROGRA~1\COMMON~1\MERCUR~1\FUNCTI~1\Java\classes;C:\PROGRA~1\COMMON~1\MERCUR~1\FUNCTI~1\Java\classes\jasmine.jar
Exception in thread "main"



Can some one please help me.
avatar
metman
Amateur
Amateur
Posts : 58
Join date : 2010-04-02

can't make RC code to run Empty Re: can't make RC code to run

Wed May 05, 2010 11:53 pm
You have no main method. However, you are using jUnit 4+, so there are a few things you should be doing (or not doing).

1. Your tests shouldn't extend TestCase/SeleneseTestCase. That was the way in jUnit 3 and before, but not jUnit 4.

2. Use annotations. In jUnit 4+, the primary annotations to use are @BeforeClass, @AfterClass, @Before, @After, and @Test. The way you use annotations is to put them just before each method. The way they work is:
@BeforeClass and @AfterClass are methods that will run once, as the names suggest, before and after the whole class runs. Generally, these are used for environment setup/tear down steps, like initializing and cleaning up a test environment required for all your tests to run. @Before and @After run before and after each individual test. These are generally used for per test generic setup steps, for selenium tests for example, that is often setting up/tearing down browser sessions. @Test is the annotation used to mark the methods that are actual tests. jUnit test runners will look for these annotations when trying to run tests, and jUnit aware IDEs will do the same.
Sponsored content

can't make RC code to run Empty Re: can't make RC code to run

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