Logo QF-Test

Finding valuable answers
in the Mailing List Archive.


Free Trial  Download  Buy

Thomas Max, QF-Test training and support

Use the full-text search on our web site to find helpful tips on the mailing list.

Thomas Max, 
Sr. Software Engineer & Trainer, QFS

2017 up to now  | 2016 | 2015 | 2014 | 2013 | 2012 | 2011 | 2010 | 2009 | 2008 | 2007

(older archive entries before 2007 are not shown here, but included in the onsite-search)

Mailing List - Entries of 2011

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[QF-Test] Selecting rows from a data driver node

  • Subject: [QF-Test] Selecting rows from a data driver node
  • From: <Christopher.Stanbridge@?.au>
  • Date: Mon, 21 Nov 2011 15:03:44 +1100

Hi List,

I've got a large csv (100K lines) with key pair values I'd like to check. I've created a data driver that uses this csv and I'd like to select n random rows from this file in a loop as a spot check.

Currently I have:

DataDriver: csvfile
  -> Get Rowcount  [ Rowcount = sum(1 for line in open(rc.lookup('csvfile'))) ]
  -> Set variable TotalNumberOfTestsToRun
        -> Loop $(TotalNumberOfTestsToRun)
              -> qfs.utils.random.getNumberFromRange (lowest = 1, highest = $(Rowcount))
              -> RunTest

The results is that I always get the first row in my file executed. Is there a way to select n random rows from the file?

Thanks in advance,


Videos Downloads Documentation Buy Free Trial