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

Lost Password?


Testing Tools >> Seapine QA Wizard

Pages: 1

Reged: 03/18/11
Posts: 3
DDT Iteration
      #664996 - 03/18/11 09:12 AM

Good Afternoon All,

I am currently on my second day of evaluating QAWP and I have a query regarding DDT and iterating through the reocrds in a datasheet.

I currently have a sheet with 1000 rows of random personal data that I need to use for input on a web page. The first run is fine, but I cannot figure out how to make it move on to the next record when the test script is run again.

I have added the below code which I am using at the moment (which just uses the same row each time):

Personal_Data = OpenRecordset("Personal Data") 'Open the recordset

NextRow(Personal_Data) 'Increment the "active" row

If Not RecordsetEOF(Personal_Data) Then 'Make sure there is a second record

'Read the data from the recordset
firstName = GetRowValue(Personal_Data, "First_Name")
lastName = GetRowValue(Personal_Data, "Last_Name")
email = GetRowValue(Personal_Data, "Email")
house = GetRowValue(Personal_Data, "House")
street = GetRowValue(Personal_Data, "Street")
city = GetRowValue(Personal_Data, "City")
county = GetRowValue(Personal_Data, "County")
postcode = GetRowValue(Personal_Data, "Post_Code")
phone = GetRowValue(Personal_Data, "Phone_Number")


Fail("Error: the second record does not exist") 'Fail with an error message

End If

I look forward to your input



Post Extras: Print Post   Remind Me!   Notify Moderator  

Reged: 08/12/10
Posts: 2
Re: DDT Iteration [Re: BradleyM]
      #665173 - 03/21/11 05:09 AM

It sounds to me like you might be mixing the two modes that are in QA Wizard Pro for data driven testing. The first, associating a data sheet with a script, is when you select the data sheet from the Data Source drop down (or from the script properties). In the case, the data sheet is automatically opened, your script is run once per row, and you access the data using the Cell statement. The other method is when you want to explicitly manage the data sheet your self. In this case, you call OpenRecordset, NextRow, GetRowValue, etc.
When you use this approach, you don't use the Data Source drop down, and you do usually have some sort of loop in your code where you call NextRow. It often looks something like

bugs = OpenRecordset("Personal Data")


While Not RecordsetEOF(bugs) Then
summary = GetRowValue(bugs, "summary")

You can take a look at this video on how to use data sheets, which might help

Post Extras: Print Post   Remind Me!   Notify Moderator  

Reged: 03/18/11
Posts: 3
Re: DDT Iteration [Re: JeffAmfahr]
      #665214 - 03/21/11 09:34 AM

Hi Jeff,

Thanks for the reply. For reference purposes I have replied on this thread as well as the one on the Seapine forum.

I spent a bit of time on another work-around for this.
I ended up creating a separate excel file, I then used some VBA script to create a counter and then copy one line from the large excel source file to the new file so it only contains one row of data.

I have now amended my QAWP script to run this excel macro and it now sets the data in the script using the new single row spreadsheet.

This seems to be working so far, and it means that I can create new test data separately from the datasheet being used by QAWP.

I have posted the excel VBA script below for reference:

Sub Copy_Next_Record()
' Copy_Next_Record Macro
Application.Workbooks.Open ("C:\Documents and Settings\user\My Documents\QA Wizard Pro Workspaces\Talent\Personal_Data.xls")
Dim RowCount As Range
Set RowCount = Workbooks("Full_Personal_Data.xls").Worksheets("Count").Range("A1")
Rows(RowCount).Copy Destination:=Workbooks("Personal_Data.xls").Worksheets("Sheet1").Rows(2)
RowCount.Value = RowCount.Value + 1
Workbooks("Personal_Data.xls").Close True
Workbooks("Full_Personal_Data.xls").Close True
End Sub

Thanks for your input.



Post Extras: Print Post   Remind Me!   Notify Moderator  
Rich W.

Reged: 03/05/04
Posts: 5815
Loc: West Coast of the East Coast!
Re: DDT Iteration [Re: BradleyM]
      #665350 - 03/22/11 04:58 AM

If that works for you then great. The issue with using a macro in EXCEL is moving the script to another machine. You have to do some data manipulation to get your original macro to run on a new host machine, whereas with Jeff's script technique of using the tool's functionality it is completely portable. Just something you need to have in the back of your mind for future growth.

Personal Comment

Success is the ability to go from one failure to another with no loss of enthusiasm.
~ Winston Churchill ~

...Rich Wagner

Post Extras: Print Post   Remind Me!   Notify Moderator  

Reged: 03/18/11
Posts: 3
Re: DDT Iteration [Re: Rich W.]
      #665371 - 03/22/11 06:44 AM

Hi Rich

Thanks for the heads up, it was something I was aware of.

Currently I am the only tester in this department, so it will be a while before I have to think about multiple machines etc. At which point I will hopefully be more versed in the ways of QAWP.



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

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

Moderator:  AJ 

Print Topic

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

Topic views: 4123

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5