Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» FlexMonkium Download Not available under Gorillalogic site
Thu Dec 08, 2016 5:40 pm by bhanu.praveen

» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

can't make RC code to run

View previous topic View next topic Go down

can't make RC code to run

Post by dbekkerman on 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");
}

}

dbekkerman

Posts : 2
Join date : 2010-01-29

Back to top Go down

Re: can't make RC code to run

Post by Adviser on 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

Adviser
------------------------
------------------------

Posts : 379
Join date : 2009-07-30
Location : India

http://seleniumforum.forumotion.net

Back to top Go down

Re: can't make RC code to run

Post by Adviser on Fri Jan 29, 2010 11:38 am


Adviser
------------------------
------------------------

Posts : 379
Join date : 2009-07-30
Location : India

http://seleniumforum.forumotion.net

Back to top Go down

Re: can't make RC code to run

Post by dbekkerman on 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 ... gosh I spent 3 freaking days trying to make it run

Thank you !!!

dbekkerman

Posts : 2
Join date : 2010-01-29

Back to top Go down

Re: can't make RC code to run

Post by mjd2010 on 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.

mjd2010

Posts : 2
Join date : 2010-05-04

Back to top Go down

Re: can't make RC code to run

Post by metman on 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.

metman
Amateur
Amateur

Posts : 58
Join date : 2010-04-02

Back to top Go down

Re: can't make RC code to run

Post by Sponsored content Today at 7:15 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