Search
 
 

Display results as :
 


Rechercher Advanced Search

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

how to automate tests through selenium?

View previous topic View next topic Go down

how to automate tests through selenium?

Post by jaz on Thu Jun 28, 2012 1:28 pm

hii...
I wanted to know that how do I automate testing with the help of Selenium? I have a few html5 modules which i ran on the browser, and now I have to automate my tests so that my colleagues who are not aware with selenium can develop the automated tests with just a few clicks.
So please tell me how do i do that ???

jaz
Active particpant
Active particpant

Posts : 10
Join date : 2012-06-27

Back to top Go down

Re: how to automate tests through selenium?

Post by jaz on Fri Jun 29, 2012 4:41 pm

hello....
I recorded a test in Selenium IDE, and then exported it as a JUnit file.
I then opened the file using NetBeans.
but the code shows a few errors and does not support all the interfaces included.
I am also not able to write a main program in the code.
Please help me solving the error.

jaz
Active particpant
Active particpant

Posts : 10
Join date : 2012-06-27

Back to top Go down

Re: how to automate tests through selenium?

Post by iautomate on Sun Jul 01, 2012 6:35 pm

Hi,

First of all if your colleagues are not familiar with Selenium they cant develop automated tests using it and next thing is it is always recommended to develop scripts instead of just doing a record and play since this method is going to create a lot of problems in maintaining your tests and its just a waste of time and money. Please consider learning the tool properly and then implementing the tests this will yield better results.

iautomate

Posts : 8
Join date : 2012-06-06
Location : Bengaluru

Back to top Go down

Re: how to automate tests through selenium?

Post by jaz on Mon Jul 02, 2012 2:08 am

I started writing my own code for the tests in NetBeans. But it showed me errors that all files were not included. It also showed an error when I tried to declare an object of WebDriver.

So what all jar files am I supposed to include ??

jaz
Active particpant
Active particpant

Posts : 10
Join date : 2012-06-27

Back to top Go down

Re: how to automate tests through selenium?

Post by jaz on Mon Jul 02, 2012 2:10 am

Also, I had copied the code from the Internet, I do not understand it as of now. So can you please suggest or help me how to begin with it ??

jaz
Active particpant
Active particpant

Posts : 10
Join date : 2012-06-27

Back to top Go down

Re: how to automate tests through selenium?

Post by iautomate on Mon Jul 02, 2012 11:04 am

I understand you are using java as your programming language , you can download the dependent libs from the below location. Extract the zip file and add the libs to your project in netbeans. I have never used netbeans i use eclipse as my IDE. Once you configure the project you can start writing your code. Knowledge of java is a must without which you cant proceed.

http://seleniumhq.org/download/

iautomate

Posts : 8
Join date : 2012-06-06
Location : Bengaluru

Back to top Go down

Re: how to automate tests through selenium?

Post by jaz on Mon Jul 02, 2012 1:11 pm

I have a little knowledge about java. But I am confused on how to develop code for the tests.
Basically, I have to write code for testing html5 modules.

The textboxes and labels that have been declared on the html5 pade have ids, so can i use those ids in my java code and work with it? Or will I have to declare new variables for them in my java code ?

jaz
Active particpant
Active particpant

Posts : 10
Join date : 2012-06-27

Back to top Go down

Re: how to automate tests through selenium?

Post by jaz on Mon Jul 02, 2012 1:26 pm

After exporting my recorded selenium test to JUnit4(Webdriver) and opening it in NetBeans, I tried to run the code but it showed me an error regarding main class not found.
I tries defining the main class and creating an object of the class, but it still shows an error and I do not know how to proceed.

here is my code, can you please tell me what should I write in the main class???
--
I tries to send you my code in the message here, but I am not allowed to do that. So please let me know how to proceed further??

jaz
Active particpant
Active particpant

Posts : 10
Join date : 2012-06-27

Back to top Go down

Re: how to automate tests through selenium?

Post by iautomate on Mon Jul 02, 2012 1:41 pm

This looks like an import error , please import all the jars and configure your classpath and add these jars and hopefully your issue will be resolved.

iautomate

Posts : 8
Join date : 2012-06-06
Location : Bengaluru

Back to top Go down

Re: how to automate tests through selenium?

Post by jaz on Mon Jul 02, 2012 4:53 pm

I created the main class in a program and called the required funstions using the object.
But the following error comes up

Exception in thread "main" java.lang.RuntimeException: Could not contact Selenium Server; have you started it on 'localhost:4444' ?

Connection refused: connect
at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:104)
at com.example.tests.tets_introduction2.setUp(tets_introduction2.java:14)
at com.example.tests.tets_introduction2.main(tets_introduction2.java:39)
Java Result: 1

jaz
Active particpant
Active particpant

Posts : 10
Join date : 2012-06-27

Back to top Go down

Re: how to automate tests through selenium?

Post by iautomate on Mon Jul 02, 2012 4:59 pm

I guess you are using the Selenium IDE and not the webdriver , I doubt i would not be able to help you on Selenium IDE since i have not worked on it. If you are starting a new project and not migrating your project i recommend you to go for webdriver as the Selenium IDE is depreciated and webdriver is much more advanced.

iautomate

Posts : 8
Join date : 2012-06-06
Location : Bengaluru

Back to top Go down

Re: how to automate tests through selenium?

Post by jaz on Mon Jul 02, 2012 6:53 pm

so have can i start using WebDriver??

jaz
Active particpant
Active particpant

Posts : 10
Join date : 2012-06-27

Back to top Go down

Re: how to automate tests through selenium?

Post by jaz on Mon Jul 02, 2012 7:17 pm

When I use Selenium IDE, the tets are recorded and the logs are saved.
Is there anyway I can save those logs in a file or display it somewhere??

jaz
Active particpant
Active particpant

Posts : 10
Join date : 2012-06-27

Back to top Go down

Re: how to automate tests through selenium?

Post by Sponsored content Today at 5:11 pm


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