Data Driven test with Selenium

View: New views
8 Messages — Rating Filter:   Alert me  

Data Driven test with Selenium

by HS-10 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

How to do data driven test using selenium..?
can I give the data in excel sheet/file and retrieve it with my scripts? If so how?
If not, what type of does Selenium support...?
Pls give a clear idea..? I new to Selenium..


Thanks,
Jagan J
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5300&messageID=14738#14738

---------------------------------------------------------------------
To unsubscribe, e-mail: selenium-users-unsubscribe@...
For additional commands, e-mail: selenium-users-help@...


Parent Message unknown RE: Data Driven test with Selenium

by Roger Foden :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jagen,
        you could try to generate Selenese scripts from a spreadsheet,
ie the commands as well as the data, using a macro etc.
        Or, better I think, you could use SeleniumRC and use the
facilities of whichever language you choose to get the data out of a
spreadsheet (and perhaps write data/results back to the spreadsheet). I
have been using SRC/java/TestNG/eclipse and a java utility I found to
read .csv files, derived from a spreadsheet.

Thanks,
        Roger.

-----Original Message-----
From: Jagan [mailto:forum-selenium-users2@...]
Sent: 16 November 2006 11:16
To: selenium-users@...
Subject: [selenium-users] Data Driven test with Selenium

How to do data driven test using selenium..?
can I give the data in excel sheet/file and retrieve it with my scripts?
If so how?
If not, what type of does Selenium support...?
Pls give a clear idea..? I new to Selenium..


Thanks,
Jagan J
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5300&messageID=14738#14738

---------------------------------------------------------------------
To unsubscribe, e-mail: selenium-users-unsubscribe@...
For additional commands, e-mail: selenium-users-help@...
 
The very latest from Talis
read the latest news at www.talis.com/news
listen to our podcasts www.talis.com/podcasts
see us at these events www.talis.com/events
join the discussion here www.talis.com/forums
join our developer community www.talis.com/tdn
and read our blogs www.talis.com/blogs

 
Any views or personal opinions expressed within this email may not be those of Talis Information Ltd. The content of this email message and any files that may be attached are confidential, and for the usage of the intended recipient only. If you are not the intended recipient, then please return this message to the sender and delete it. Any use of this e-mail by an unauthorised recipient is prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: selenium-users-unsubscribe@...
For additional commands, e-mail: selenium-users-help@...


Re: Data Driven test with Selenium

by balamurugan jayabalan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi friend,

    I implemented data driven testing for one of the application in our company. i read the external file as a input and read the script. Follwing is the code.

package com.example.tests;

import com.thoughtworks.selenium.*;

import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.regex.Pattern;

public class Create extends SeleneseTestCase {
                public void setUp() throws Exception {
                        setUp("http://user your ip address or application link");
                        Create();
                }
public void Create() {
        selenium.open("/SVManager/welcome.do");
        selenium.type("username", "admin");
        selenium.type("password", "test");
        selenium.click("ImageField");
        selenium.waitForPageToLoad("30000");
        selenium.click("//img[@id='imglogout' and @onclick=\"fnClick('3')\"]");
        BufferedReader in = null;
        InputStreamReader inputStream = null;
        try{
                //int flag;
                inputStream = new InputStreamReader(new FileInputStream("C:"+File.separator+"user.txt"));
                in = new BufferedReader(inputStream);
                String line = null;
                String user = "";
                String pwd = "";
                while((line = in.readLine()) != null){
                        String[] data = line.split(" ");
                        if(data.length >= 1){
                                user = data[0];
                                pwd = data[1];
                                System.out.println("user : "+user);
                                System.out.println("pwd : "+pwd);
                        //for(int i=0;i<10;i++){
                                selenium.waitForPageToLoad("30000");
                                selenium.click("//a/font");
                                selenium.waitForPageToLoad("30000");
                                selenium.type("username", user);
                                selenium.type("password", pwd);
                                selenium.type("fullName", "joneywalse");
                                selenium.select("role", "label=Broker");
                                selenium.type("emailList", "jon@smt.com");
                                selenium.click("isMultipleLogin");
                                selenium.addSelection("strDeskId", "label=ASIA");
                                selenium.addSelection("strDeskId", "label=Mex Derivatives");
                                selenium.click("button");
                                selenium.select("primaryPlatform", "label=ASIA");
                                selenium.click("Image1");
                                selenium.waitForPageToLoad("30000");
                                try{
                                        selenium.type("custId", "1040");
                                        selenium.select("role", "label=Broker");
                                        selenium.type("strmaxCommandAmount", "1");
                                        selenium.type("strmaxcommandPeriod", "1");
                                        selenium.type("strinstitutionid", "14");
                                        selenium.click("canViewInstitution");
                                        selenium.type("location", "14");
                                        selenium.click("Image1");
                                        selenium.waitForPageToLoad("30000");
                                        selenium.type("custId", "1040");
                                        selenium.select("role", "label=Broker");
                                        selenium.type("strmaxCommandAmount", "100");
                                        selenium.type("strmaxcommandPeriod", "100");
                                        selenium.type("strinstitutionid", "14");
                                        selenium.click("canViewInstitution");
                                        selenium.type("location", "14");
                                        selenium.click("Image1");
                                        selenium.waitForPageToLoad("30000");
                                }catch(Exception ex){
                                        ex.printStackTrace();
                                        selenium.open("/SVManager/listUser.do");
                                        selenium.waitForPageToLoad("30000");
                                }
                        }
                }
        }catch(Exception ex){
                ex.printStackTrace();
        }finally{
                        try{
                                if(in != null)
                                        in.close();
                               
                                if(inputStream != null)
                                        inputStream.close();
                        }catch(Exception ex){
                                ex.printStackTrace();
                        }
                }
}
public static void main(String[] args) {
        Create newTest = new Create();
                try {
                        newTest.setUp();
                } catch (Exception e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
        }
}

with thanks
balamurugan jayabalan
HS-10 wrote:
How to do data driven test using selenium..?
can I give the data in excel sheet/file and retrieve it with my scripts? If so how?
If not, what type of does Selenium support...?
Pls give a clear idea..? I new to Selenium..


Thanks,
Jagan J
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5300&messageID=14738#14738

---------------------------------------------------------------------
To unsubscribe, e-mail: selenium-users-unsubscribe@openqa.org
For additional commands, e-mail: selenium-users-help@openqa.org

RE: Data Driven test with Selenium

by mahi002 () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi All,

I am new to selenium. I need to do datadriven testing using selenium RC. I have generated script by recording in IDE, saved and exported as java script.

Can any one explain how to use the script in RC/eclipse/java and run the test by feeding data from xls/text file and get the results back to xls/text file...

Thanks in advance,
Mahesh


Roger Foden wrote:
Jagen,
        you could try to generate Selenese scripts from a spreadsheet,
ie the commands as well as the data, using a macro etc.
        Or, better I think, you could use SeleniumRC and use the
facilities of whichever language you choose to get the data out of a
spreadsheet (and perhaps write data/results back to the spreadsheet). I
have been using SRC/java/TestNG/eclipse and a java utility I found to
read .csv files, derived from a spreadsheet.

Thanks,
        Roger.

-----Original Message-----
From: Jagan [mailto:forum-selenium-users2@openqa.org]
Sent: 16 November 2006 11:16
To: selenium-users@openqa.org
Subject: [selenium-users] Data Driven test with Selenium

How to do data driven test using selenium..?
can I give the data in excel sheet/file and retrieve it with my scripts?
If so how?
If not, what type of does Selenium support...?
Pls give a clear idea..? I new to Selenium..


Thanks,
Jagan J
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5300&messageID=14738#14738

---------------------------------------------------------------------
To unsubscribe, e-mail: selenium-users-unsubscribe@openqa.org
For additional commands, e-mail: selenium-users-help@openqa.org
 
The very latest from Talis
read the latest news at www.talis.com/news
listen to our podcasts www.talis.com/podcasts
see us at these events www.talis.com/events
join the discussion here www.talis.com/forums
join our developer community www.talis.com/tdn
and read our blogs www.talis.com/blogs

 
Any views or personal opinions expressed within this email may not be those of Talis Information Ltd. The content of this email message and any files that may be attached are confidential, and for the usage of the intended recipient only. If you are not the intended recipient, then please return this message to the sender and delete it. Any use of this e-mail by an unauthorised recipient is prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: selenium-users-unsubscribe@openqa.org
For additional commands, e-mail: selenium-users-help@openqa.org

RE: Data Driven test with Selenium

by boomi_selenium :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Mahesh,

You can use ADODB for data driven testing. I am using Ruby and Selenium RC. I developed scripts in ruby using ADODB for Data Driven testing. Its working fine. You try to create ADODB connection using Java Script.

Regards,
Boomi.



Hi All,

I am new to selenium. I need to do datadriven testing using selenium RC. I have generated script by recording in IDE, saved and exported as java script.

Can any one explain how to use the script in RC/eclipse/java and run the test by feeding data from xls/text file and get the results back to xls/text file...

Thanks in advance,
Mahesh


Roger Foden wrote:
Jagen,
        you could try to generate Selenese scripts from a spreadsheet,
ie the commands as well as the data, using a macro etc.
        Or, better I think, you could use SeleniumRC and use the
facilities of whichever language you choose to get the data out of a
spreadsheet (and perhaps write data/results back to the spreadsheet). I
have been using SRC/java/TestNG/eclipse and a java utility I found to
read .csv files, derived from a spreadsheet.

Thanks,
        Roger.

-----Original Message-----
From: Jagan [mailto:forum-selenium-users2@openqa.org]
Sent: 16 November 2006 11:16
To: selenium-users@openqa.org
Subject: [selenium-users] Data Driven test with Selenium

How to do data driven test using selenium..?
can I give the data in excel sheet/file and retrieve it with my scripts?
If so how?
If not, what type of does Selenium support...?
Pls give a clear idea..? I new to Selenium..


Thanks,
Jagan J
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5300&messageID=14738#14738

---------------------------------------------------------------------
To unsubscribe, e-mail: selenium-users-unsubscribe@openqa.org
For additional commands, e-mail: selenium-users-help@openqa.org
 
The very latest from Talis
read the latest news at www.talis.com/news
listen to our podcasts www.talis.com/podcasts
see us at these events www.talis.com/events
join the discussion here www.talis.com/forums
join our developer community www.talis.com/tdn
and read our blogs www.talis.com/blogs

 
Any views or personal opinions expressed within this email may not be those of Talis Information Ltd. The content of this email message and any files that may be attached are confidential, and for the usage of the intended recipient only. If you are not the intended recipient, then please return this message to the sender and delete it. Any use of this e-mail by an unauthorised recipient is prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: selenium-users-unsubscribe@openqa.org
For additional commands, e-mail: selenium-users-help@openqa.org


RE: Data Driven test with Selenium

by mahi002 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Boomi,

Thanks for your response. I could do datadriven testing using Selenium RC and eclipse in java. Its working now. But the thing is I need to test this for multiple websites parallely. (e.g. by running test, selenium should open two IE browsers parallely as against existing test opening only one browser) Can this be possible with RC?? anyone can help me...

Thanks,
Mahesh
 

Hi Mahesh,

You can use ADODB for data driven testing. I am using Ruby and Selenium RC. I developed scripts in ruby using ADODB for Data Driven testing. Its working fine. You try to create ADODB connection using Java Script.

Regards,
Boomi.


mahi002 wrote:
Hi All,

I am new to selenium. I need to do datadriven testing using selenium RC. I have generated script by recording in IDE, saved and exported as java script.

Can any one explain how to use the script in RC/eclipse/java and run the test by feeding data from xls/text file and get the results back to xls/text file...

Thanks in advance,
Mahesh


Roger Foden wrote:
Jagen,
        you could try to generate Selenese scripts from a spreadsheet,
ie the commands as well as the data, using a macro etc.
        Or, better I think, you could use SeleniumRC and use the
facilities of whichever language you choose to get the data out of a
spreadsheet (and perhaps write data/results back to the spreadsheet). I
have been using SRC/java/TestNG/eclipse and a java utility I found to
read .csv files, derived from a spreadsheet.

Thanks,
        Roger.

-----Original Message-----
From: Jagan [mailto:forum-selenium-users2@openqa.org]
Sent: 16 November 2006 11:16
To: selenium-users@openqa.org
Subject: [selenium-users] Data Driven test with Selenium

How to do data driven test using selenium..?
can I give the data in excel sheet/file and retrieve it with my scripts?
If so how?
If not, what type of does Selenium support...?
Pls give a clear idea..? I new to Selenium..


Thanks,
Jagan J
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5300&messageID=14738#14738

---------------------------------------------------------------------
To unsubscribe, e-mail: selenium-users-unsubscribe@openqa.org
For additional commands, e-mail: selenium-users-help@openqa.org
 
The very latest from Talis
read the latest news at www.talis.com/news
listen to our podcasts www.talis.com/podcasts
see us at these events www.talis.com/events
join the discussion here www.talis.com/forums
join our developer community www.talis.com/tdn
and read our blogs www.talis.com/blogs

 
Any views or personal opinions expressed within this email may not be those of Talis Information Ltd. The content of this email message and any files that may be attached are confidential, and for the usage of the intended recipient only. If you are not the intended recipient, then please return this message to the sender and delete it. Any use of this e-mail by an unauthorised recipient is prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: selenium-users-unsubscribe@openqa.org
For additional commands, e-mail: selenium-users-help@openqa.org

Re: Data Driven test with Selenium

by kjaladi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

thanks for sharing this.

thanks.

Re: Data Driven test with Selenium

by BoBoMonkey :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi All,

I have created a tutorial on Data Driven testing using Selenium & TestNG in the Eclipse environment on my blog. I have described a very simple but very powerful way of storing & retrieving test data from excel files and and linking them to the test logic in your java test class file. The example given is self containing and very easy to follow. I have used this approach to automate close to 1000 test cases so far.

Cheers