SPONSORS:






User Tag List

Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Sep 2002
    Location
    ca
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    access multiple spreadsheets within a test script

    how do i go about accessing multiple spreadsheets from one excel file? i have data driven testcases and i need to capture the data from different spreadsheets. is there a way i could parameterize the name of the spreadsheet in the script since i'll be using the same procedure anyway?

    App.TypeKeys(rData.recEdit_.Name)

    App.TypeKeys(rData1.recEdit2_.Name)

    is there a way I could parameterize recEdit_ & recEdit2?



    ------------------

  2. #2
    Junior Member
    Join Date
    Dec 2002
    Posts
    28
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: access multiple spreadsheets within a test script

    I am having the same problem. If anybody found any solution to this problem. Please share with us
    Thanks

  3. #3
    ksg
    ksg is offline
    Junior Member
    Join Date
    Nov 2003
    Location
    India
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: access multiple spreadsheets within a test script

    Hi,

    I am providing this solution with an assumption that you are using "DB_Tester functions".

    //execute a SQL statement - For Sheet No.1
    hSQL1=DB_ExecuteSQL(hDB,"SELECT * from `Sheet1$`")

    DB_FetchNext (hSQL1,testcasename,testdata,expectedvalue)

    where :
    hSQL1 - SQL Query
    testcasename,testdata,expectedvalue - variables - stores values fetched from Sheet No.1 , Values are fetched sequentially ... Column No.1 , 2 ...

    This is the SQl query you can use for getting data from Sheet No.1. Similarly you can fetch the data from Sheet 2..3 and so on.

    If you want to know DB_Test functions, then please refer following topic discussed in QA Forum.

    http://www.qaforums.com/cgi-bin/foru...c;f=1;t=005154


    http://www.qaforums.com/cgi-bin/foru...c;f=1;t=005893

  4. #4
    Junior Member
    Join Date
    Dec 2002
    Posts
    28
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: access multiple spreadsheets within a test script

    I was actually interested in seeing any solution created for data driven testcases created by the workflow.

  5. #5
    Senior Member
    Join Date
    Apr 2001
    Location
    San Diego,CA,USA
    Posts
    108
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: access multiple spreadsheets within a test script

    Here is an example that uses different worksheets in a single excel file as well as different excel file.

    haven't worked with workflow though! Just took a cursory look and there is no way to access two different excel files within one testcase, but for two different testcases you can do it.
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">[+] testcase accessMultipleWorkSheets()
    [ ]
    [ ] HANDLE hDB, hDB1
    [ ] HANDLE hSQL, hSQL1
    [ ] HANDLE hs, hs1
    [ ] int i=0
    [ ] int j=0
    [ ]
    [ ] list of ANYTYPE ls_data
    [ ]
    [ ] string desc,dlg,cmp,typ,exp,pre,post,sml,id,msg
    [+] do
    [ ]
    [ ] hDB = DB_Connect (&quot;DRIVER=Microsoft Excel Driver (*.xls);FIRSTROWHASNAMES=1;READONLY=FALSE;DRIVERID =790;DBQ=D:\User-Data\QA_DOC_AREA\NotePad_excel\Test_data.xls&quot
    [ ] //execute a SQL statement
    [ ] hSQL = DB_ExecuteSQL (hDB, &quot;SELECT * from [Verify1$]&quot
    [ ] //while there are still rows to retrieve
    [-] while DB_FetchNext (hSQL, desc,dlg,cmp,typ,exp, pre, post)
    [ ] print(&quot;{++i}:{dlg} {cmp} {typ} {exp}&quot
    [ ]
    [ ] print(&quot;DONE WITH FIRST SHEET&quot
    [ ] hSQL = DB_ExecuteSQL (hDB, &quot;SELECT * from [Sheet2$]&quot
    [-] while DB_FetchNext (hSQL, desc,dlg,cmp,typ,exp, pre, post)
    [ ] print(&quot;{++i}:{dlg} {cmp} {typ} {exp}&quot
    [ ]
    [ ]
    [ ] //Now connect to another workbook that is a different excel file
    [ ] hDB1 = DB_Connect (&quot;DRIVER=Microsoft Excel Driver (*.xls);FIRSTROWHASNAMES=1;READONLY=FALSE;DRIVERID =790;DBQ=c:\as1.xls&quot
    [ ] hSQL1 = DB_ExecuteSQL (hDB1, &quot;SELECT * from [Sheet1$]&quot
    [ ] int numb
    [ ]
    [-] while DB_FetchNext (hSQL1, sml,id,msg)
    [ ] //print(&quot;{++j}:{numb}&quot
    [ ] print(&quot;{++j}:{sml} {id} {msg}&quot
    [ ]
    [ ]
    [ ]
    [ ] //clean up the query1
    [ ] DB_FinishSql (hSQL)
    [ ]
    [ ] //disconnect from the database1
    [ ] DB_Disconnect (hDB)
    [ ]
    [ ]
    [ ] //clean up the query 2
    [ ] DB_FinishSql (hSQL1)
    [ ]
    [ ] //disconnect from the database 2
    [ ] DB_Disconnect (hDB1)
    [ ]
    [ ]
    [ ]
    [ ]
    [+] except
    [ ] exceptlog()
    [ ] </pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:21 PM.

Copyright BetaSoft Inc.