The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> Selenium

Pages: 1
mfsi_sitamj
Newbie


Reged: 10/11/11
Posts: 15
Configure open office with Selenium web driver
      #700376 - 03/05/12 05:57 AM

Hi all,

How can i parameterize selenium web driver test scripts using open office excel?
Is there any support in selenium for doing that?

Please suggest me for the same.

Thanks in advanced
Sitam


Post Extras: Print Post   Remind Me!   Notify Moderator  
dlai
Junior Member


Reged: 05/02/06
Posts: 1041
Loc: CA, USA
Re: Configure open office with Selenium web driver [Re: mfsi_sitamj]
      #700403 - 03/05/12 08:20 AM

I'm assuming you're talking about webdriver. In this case, what you want to create your test using the following organization...

1: Data provider you implement that'll read the office file and create an object array it can pass in to the test in the layer below.

2: JUnit, TestNg, or any other test framework that supports external data sources. This is where you'll write your data driven test. These test will call the page object in the layer below using the parameters it gets in from the data object.

3: Page object layer. Here is where you'll do the @Webelement annotations and implement small atomic actions as parameterized method calls.

--------------------
David Lai
Sr. QA / Test Lead
LinkedIn profile


Post Extras: Print Post   Remind Me!   Notify Moderator  
mfsi_sitamj
Newbie


Reged: 10/11/11
Posts: 15
Re: Configure open office with Selenium web driver [Re: dlai]
      #700470 - 03/05/12 09:18 PM

I know how to do data driven testing in selenium webdriver using microsoft office excel sheet as a source of test cases and test data.

I want to know the same for open office excel.

--------------------
Sitam Jana
"Visualize a dream, chase a dream, live a dream"
QA engineer
Mindfire Solutions

Edited by mfsi_sitamj (03/05/12 11:46 PM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
vivek82
Advanced Member


Reged: 09/16/08
Posts: 421
Loc: India
Re: Configure open office with Selenium web driver [Re: mfsi_sitamj]
      #700481 - 03/05/12 11:56 PM

You can also save your file in xls format using open office and access data as usual like MS-Office excel.

Post Extras: Print Post   Remind Me!   Notify Moderator  
saju1982
Member


Reged: 05/25/06
Posts: 83
Loc: mumbai
Re: Configure open office with Selenium web driver [Re: vivek82]
      #700491 - 03/06/12 01:20 AM

there is no separate configurations settings for openoffice docs . if you are not interested in testng then you can use jxl or apache poi jar , add it in your build path .

--------------------
Regards
Saju Thomas


Post Extras: Print Post   Remind Me!   Notify Moderator  
dlai
Junior Member


Reged: 05/02/06
Posts: 1041
Loc: CA, USA
Re: Configure open office with Selenium web driver [Re: mfsi_sitamj]
      #700547 - 03/06/12 07:22 AM

Quote:

I know how to do data driven testing in selenium webdriver using microsoft office excel sheet as a source of test cases and test data.

I want to know the same for open office excel.




If you got that far, then it's pretty simple. Just switch out the database driver or api you're using to read the excel document with one that reads open office.

--------------------
David Lai
Sr. QA / Test Lead
LinkedIn profile


Post Extras: Print Post   Remind Me!   Notify Moderator  
mfsi_sitamj
Newbie


Reged: 10/11/11
Posts: 15
Re: Configure open office with Selenium web driver [Re: dlai]
      #700551 - 03/06/12 07:35 AM Attachment (413 downloads)

@Saju Thomas,
You are right that we can use jxl API or poi API for that purpose. But whatever API i use, i need to write a program
generally called as xls_reader.java that will make me enable
to read from or write into the .xls file.


I have attached one xls_reader.java which uses poi API but this program is only working for .xlsx file. I need the same type of program which will work for .xls file.

So, please if anyone have that, provide me. I need it badly.

--------------------
Sitam Jana
"Visualize a dream, chase a dream, live a dream"
QA engineer
Mindfire Solutions


Post Extras: Print Post   Remind Me!   Notify Moderator  
SHANMUGAVEL_C
Member


Reged: 09/30/10
Posts: 241
Loc: TN, India
Re: Configure open office with Selenium web driver [Re: mfsi_sitamj]
      #700634 - 03/07/12 04:06 AM

Hi sitam,
You are done. Just use like below.
Code:

if(fileName.indexOf("xlsx") < 0) {
wb = new HSSFWorkbook(new FileInputStream(new File(excelFileNameWithPath)));
ws = wb.getSheet(sheetName);
} else {
wb = new XSSFWorkbook(excelFileNameWithPath);
ws = (XSSFSheet) wb.getSheet(sheetName);
}



Thanks...

--------------------
I am speaking for myself, not for my employer nor any one.
Automation Ecstasy


Post Extras: Print Post   Remind Me!   Notify Moderator  
mfsi_sitamj
Newbie


Reged: 10/11/11
Posts: 15
Re: Configure open office with Selenium web driver [Re: SHANMUGAVEL_C]
      #701307 - 03/14/12 01:38 AM

@ Shanmugavel,

I have tried with your piece of code. But the problem is in placing your snippet in the right place of xls_Reader.java.

Can you please share full xls_Reader.java here?

Thanks in advanced
Sitam

--------------------
Sitam Jana
"Visualize a dream, chase a dream, live a dream"
QA engineer
Mindfire Solutions


Post Extras: Print Post   Remind Me!   Notify Moderator  
SHANMUGAVEL_C
Member


Reged: 09/30/10
Posts: 241
Loc: TN, India
Re: Configure open office with Selenium web driver [Re: mfsi_sitamj]
      #701423 - 03/14/12 11:26 PM

You can refer http://shanmugavelc.blogspot.in/2011/08/apache-poi-read-excel-for-use-of.html

Thanks...

--------------------
I am speaking for myself, not for my employer nor any one.
Automation Ecstasy


Post Extras: Print Post   Remind Me!   Notify Moderator  
mfsi_sitamj
Newbie


Reged: 10/11/11
Posts: 15
Re: Configure open office with Selenium web driver [Re: SHANMUGAVEL_C]
      #701428 - 03/14/12 11:57 PM

Thanks...

--------------------
Sitam Jana
"Visualize a dream, chase a dream, live a dream"
QA engineer
Mindfire Solutions


Post Extras: Print Post   Remind Me!   Notify Moderator  
lakshmi_narasimhan
Member


Reged: 06/09/08
Posts: 37
Re: Configure open office with Selenium web driver [Re: mfsi_sitamj]
      #702706 - 03/27/12 10:36 AM

I parametrize my test data from Open office (as csv) using selenium RC. I am not using apache poi, but just the opencsv jar. I did not have any stringent requirement that i have to use open office xls, so i chose open office csv.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 4 anonymous users are browsing this forum.

Moderator:  LNB, AJ, michaeljf 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 9910

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5