Results 1 to 7 of 7

Thread: Using excel instead of datapools

  1. #1

    Using excel instead of datapools

    hi all,
    i want to use excel for datadriven testing instead of datapools.can any one assist me with tha code and how to work with excel please.


  2. #2
    Junior Member
    Join Date
    Nov 2007
    Answers
    12

    Re: Using excel instead of datapools

    Below code will be useful for read/write into excel

    Dim app as object
    Dim book as object
    Dim sheet as object
    set app=createobject("excel.application")
    set book=app.workbooks.open("c:\emp.xls")
    set sheet=book.activesheet
    sheet.cells(1,1).value="hello" 'first one is row and second one is column value


  3. #3
    Junior Member
    Join Date
    Apr 2008
    Answers
    4

    Cool Re: Using excel instead of datapools

    I have got a piece of code if u can use it then its good just check it its written below
    'on error resume next
    'open data source
    dim objexcel as object
    dim objworkbook as object
    dim objworksheet as object
    set objexcel = getobject("excel.application")
    if objexcel is nothing then
    set objexcel = createobject ("excel.application")
    end if
    set objworkbook = objexcel.workbooks.open("c:\testing\testdata\placeanorderdata.xls")
    set objworksheet = objworkbook.worksheets("placeanorder")
    end sub


  4. #4
    Junior Member
    Join Date
    May 2008
    Answers
    1

    Re: Using excel instead of datapools

    how to use the datatable instead of datapool in rational robot?


  5. #5
    Junior Member
    Join Date
    Aug 2008
    Answers
    5

    Re: Using excel instead of datapools

    Hi try the below code to get the data from the EMP table
    Before execting the below table you should create a DSN
    ---------------------------------------------------------------------------
    Dim DBC as Long
    Dim varColumn
    Dim varRows
    Dim strArray (3,50) as String 'Assuming that the EMP table has 3 columns and 50 rows
    DBC = SQLOpen("DSN=DataDSN;UID=userid;PWD=passwore",,prompt:=3)
    If DBC < 0 Then
    Msgbox "Not Connected"
    End If
    varColumns = SQLExecQuery(DBC,"Select * from EMP")
    varRows = SQLRetrieve(DBC,strArray)


  6. #6
    Junior Member
    Join Date
    Oct 2008
    Answers
    1

    Re: Using excel instead of datapools

    I Tried the same script , But its showing an error message that "Illegal Statement", Any add-ins is there to identify the Script.

    Could you please give your valuable thoughts


  7. #7
    Junior Member
    Join Date
    Nov 2007
    Answers
    12

    Re: Using excel instead of datapools

    Quote Originally Posted by shilupg View Post
    I Tried the same script , But its showing an error message that "Illegal Statement", Any add-ins is there to identify the Script.

    Could you please give your valuable thoughts
    Can you send me the script you had written?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact