|
|
|
Re: Does RCPTT support Data Driven? [message #1560077 is a reply to message #1559684] |
Mon, 12 January 2015 11:26 |
|
Hello,
Thank you for the explanation. As I understand you want to read parameters from some file.
In RCPTT you can read tables from csv files and use content of them in test cases.
Take a look at the following snippet of ECL code
proc "index-of" [val list -input] [val item] {
$list | each [val elem] [val index] {
if [$elem | eq $item] { $index }
} | to-list | get 0 [int "-1"]
}
proc "get-value" [val table] [val columnName] [val rowNumber] { // this proc returns value from columnName column rowNumber row
let [val columnIndex [$table | get columns | to-list | index-of $columnName]] {
$table | get rows | to-list
| get $rowNumber | get values |to-list
| get $columnIndex
}
}
let [val table [read-csv-file "file:/temp/read-csv.csv"]] { // read table from csv-file
get-value $table "a1" 0 | log // this line writes to Error log value from column a1 row 0
}
With the table:
a1,b1
1,2
the above snippet will write to Error log value 1.
Is it suitable for you?
Please let me know if you have any questions.
Yours sincerely,
Olga.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03447 seconds