How to export export a script from selenium IDE to a Java file and include it in Java project in eclipse

Showing 1-13 of 13 messages
How to export export a script from selenium IDE to a Java file and include it in Java project in eclipse anuja 11/14/11 10:55 PM
I am beginner user of seleium. i downloaded selenium RC server and
client zip files.
I created a new project in eclipse and added the jar file as project
reference.
how can i export selenium test from it IDE to eclipse java project?
Thanx in advance.
Re: [selenium-users] How to export export a script from selenium IDE to a Java file and include it in Java project in eclipse basha 11/14/11 11:01 PM
Hi,
Start recording using ide and cut & paste in ur java script.


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


Re: [selenium-users] How to export export a script from selenium IDE to a Java file and include it in Java project in eclipse Mallikarjun Yalagi 11/14/11 11:04 PM
Hi anuja,

       To export selenium test from ide to eclipse java follow the steps:
1)open selenium ide
2)select the test cases
3)click on file option
4)select export test cases as
5)there you select junit4(remote control) if you are using junit or testng(Remote control) if you are using testng.
6)then save that file as .java
7)open that file and copy that code and paste it in eclipse.

On Tue, Nov 15, 2011 at 12:25 PM, anuja <anuja...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


Re: [selenium-users] How to export export a script from selenium IDE to a Java file and include it in Java project in eclipse Anuja Jain 11/14/11 11:21 PM
i did exactly like your steps but when i am running the test as junit test it is throwing exceptions as below.
 
 
 
 

java.lang.NoClassDefFoundError: com/google/common/base/Function
 at Test1.setUp(Test1.java:17)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
 at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
 at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
 at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
 at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
 at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
 at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
 at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Function
 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)
 ... 24 more

java.lang.NullPointerException
 at Test1.tearDown(Test1.java:29)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
 at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
 at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
 at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:37)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
 at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
 at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
 at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Re: [selenium-users] How to export export a script from selenium IDE to a Java file and include it in Java project in eclipse Mallikarjun Yalagi 11/15/11 12:20 AM
go through this link: "http://seleniumready.blogspot.com/search/label/junit",compare the code.
Thanks&Regards
Mallappa Yalagi
Re: [selenium-users] How to export export a script from selenium IDE to a Java file and include it in Java project in eclipse Prassana Anjaneyulu 11/15/11 12:46 AM
Hi Anuja,
 This kind of exception will come if the required jar files are not available in your project.
 It seems to be you wrote the script using Web-driver but forgot to place the required jar
 files..

Go to the following URL and download the Java Client Driver form Selenium-Client Drivers section, Extract it and then copy all the jars presented in 'libs' folder along with 'selenium-java-2.11.0.jar' into your Project Build Path.Then it'll resolve...

...
Re: [selenium-users] How to export export a script from selenium IDE to a Java file and include it in Java project in eclipse Prassana Anjaneyulu 11/15/11 1:02 AM
I forget to copy the link..
http://seleniumhq.org/download/
 from this link download selenium 2.0+ version client driver.


Re: How to export export a script from selenium IDE to a Java file and include it in Java project in eclipse tulsi.tester 11/15/11 2:29 AM
Hi Anuja,

I think the following exception caused due to the Class name. The
class name should be same as the File name that you have saved.
Suppose if you are saving the file as "NewTest.java", then the class
name of the file should be NewTest. Try this and let me know.
> On Tue, Nov 15, 2011 at 12:34 PM, Mallikarjun Yalagi <yalagi.ma...@gmail.com
>
> > wrote:
> > Hi anuja,
>
> >        To export selenium test from ide to eclipse java follow the steps:
> > 1)open selenium ide
> > 2)select the test cases
> > 3)click on file option
> > 4)select export test cases as
> > 5)there you select junit4(remote control) if you are using junit or
> > testng(Remote control) if you are using testng.
> > 6)then save that file as .java
> > 7)open that file and copy that code and paste it in eclipse.
>
Re: [selenium-users] Re: How to export export a script from selenium IDE to a Java file and include it in Java project in eclipse Anuja Jain 11/15/11 9:16 PM
 my test is running in eclipse now. thanx for ur help..
but the in the code SeleneseTestCase .
this is shown.I am not getting why it is shown like this.
 

 

import com.thoughtworks.selenium.*;

import org.junit.After;

import org.junit.Before;

import org.junit.Test;

import java.util.regex.Pattern;

public class FirstTest extends SeleneseTestCase {

@Before

public void setUp() throws Exception {

selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://inlvt46.iind.intel.com/");

selenium.start();

}

@Test

public void testTest1() throws Exception {

selenium.open("/NBConsole/");

assertTrue(

selenium.isTextPresent("Select View"));

}

@After

public void tearDown() throws Exception {

selenium.stop();

}

}

Re: How to export export a script from selenium IDE to a Java file and include it in Java project in eclipse Sasi kumar 11/15/11 9:27 PM
I didnt get you what is the error shown in eclipse?

On Nov 16, 10:16 am, Anuja Jain <anujamj...@gmail.com> wrote:
>  my test is running in eclipse now. thanx for ur help..
> but the in the code *SeleneseTestCase .*
> this is shown.I am not getting why it is shown like this.
>
> *
>
> *
>
> import com.thoughtworks.selenium.*;
>
> import org.junit.After;
>
> import org.junit.Before;
>
> import org.junit.Test;
>
> *import java.util.regex.Pattern*;
>
> *public class* FirstTest *extends* *SeleneseTestCase* {
>
> @Before
>
> *public* *void* setUp() *throws* Exception {
>
> *selenium* = *new* DefaultSelenium("localhost", 4444, "*chrome", "http://inlvt46.iind.intel.com/");
>
> *selenium*.start();
>
> }
>
>  @Test
>
> *public* *void* testTest1() *throws* Exception {
>
> *selenium*.open("/NBConsole/");
>
> *assertTrue*(
>
> *selenium*.isTextPresent("Select View"));
>
> }
>
>  @After
>
> *public* *void* tearDown() *throws* Exception {
>
> *selenium*.stop();
>
>
>
>
>
>
>
> }
> }
Re: [selenium-users] Re: How to export export a script from selenium IDE to a Java file and include it in Java project in eclipse Krishnan 11/15/11 9:47 PM
You mean to say that you are getting a deprecation message in eclipse ??
A strike through on a class or method normally means that, that particular class/method is deprecated (marked for deletion and would be deleted in the next release or the one after that).. its an indication to you that you are not to be using that method/class anymore but instead use something else.


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"


>
>
>
>
>
>
>
> }
> }

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


Re: [selenium-users] Re: How to export export a script from selenium IDE to a Java file and include it in Java project in eclipse Anuja Jain 11/15/11 9:53 PM
Yes exactly i am getting deprecattion message.so i will use SeleneseTestBase instead of SeleneseTestCase.
 
Thanks,
Anuja
RE: [selenium-users] Re: How to export export a script from selenium IDE to a Java file and include it in Java project in eclipse Mark Collin 11/15/11 10:27 PM

That’s because it’s deprecated.  You want to extend SeleneseTestBase instead.

 

From: seleniu...@googlegroups.com [mailto:seleniu...@googlegroups.com] On Behalf Of Anuja Jain
Sent: 16 November 2011 05:16
To: seleniu...@googlegroups.com
Subject: Re: [selenium-users] Re: How to export export a script from selenium IDE to a Java file and include it in Java project in eclipse

--

You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


-- This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error please notify postm...@ardescosolutions.com