Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1951
  • Last Modified:

Is the data driven testing possible using selenium?

Since selenium is mainly used for web automation...

can we use this for data driven testcases?
if so can you please share by taking an example.
0
Suhas .
Asked:
Suhas .
3 Solutions
 
MaduKpCommented:
I just googled it and found this,

http://groups.google.com/group/selenium-ruby/browse_thread/thread/f8d1b2cf75253b15

Please refer the sangeeta's post.. I also have been wrestling with this issue of DDT ...

I think it is a good example.

Let us know if you are looking some thing else
0
 
MaduKpCommented:
0
 
sadi77Commented:
Hi,
I found this is very useful script.
Data Driven Selenium using Excel Macros
http://clearspace.openqa.org/thread/15616

another SQAForum thread which is not what MaduKp: mentioned above - a sample script
http://www.sqaforums.com/showflat.php?Number=467996

0
 
Suveer PatilQA AnalystCommented:
Hi,
yes it is possible....
We are using the same tool in our office.
what you need to do is record your script using Selenium IDE in firefox browser
then export the script in any of the programming languages in which you are comfortable....(Hope you know how to export since you are using that tool now)
i'm using java as an example here....
Now you have to connect to the Selenium RC by using the jar's which are getting with the Selenium RC (which is used to test the application in any of the browsers where as using Selenium IDE you can only run the scripts in firefox)
now just open the script in eclipse or netbeans
then you can define a class and constructors to initiate the variables and you can run the script then the selenium will chck for the multiple values for a field.
first you have to give the invalid values then the valid values
An example is attached for date validation (format dd/mm/yyyy), string validation and number validation
If you still didn't get then get back to me so that i can help you further.....
Cheers,
Suveer
 
 

public class fieldValidations {
 
      public String[] dayValidation() {
 
            String day[] = { "45", "00", "1", " 1", "1 ", "a2", "2a", "1#", "#1",
 
                        "#1" };
 
            return day;
 
      }
 
      public String[] monthValidation() {
 
            String month[] = { "13", "00", "1", " 1", "1 ", "a2", "2a", "1#" };
 
            return month;
 
      }
 
      public String[] yearValidation() {
 
            String year[] = { "0000", "asdf", "as12", "122#", "#232",
 
                        "12as", "12  ", "  09", "09", "009" };
 
            return year;
 
      }
 
      public String[] numberValidation() {
 
            String[] number = { "as", "2a", "a2", "2@", "@2", "  ", "@#", "-23" };
 
            return number;
 
      }
 
      public  String[] stringValidation(){
 
            String[] string = {"asdf","1234","!@#$"};
 
            return string;
 
      }
 
      }

Open in new window

0
 
Suhas .QA ManagerAuthor Commented:
Thanks for the answers...

 i got a brief idea on it...
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now