automationeggplant

Eggplant - how to store dynamic values into excel cells


Here's sample code:

set myExcelDB to {type:"excel", file:ResourcePath(testRunFilePath), name:"TestRun" ,writable: Yes} 
put the records of myExcelDB into allTestRunRecords

repeat with each item of allTestRunRecords


put 1 into counter
put counter into currentRow.passed //why is this counter number not updated into my excel file?

end repeat

I had the counter values stored into the currentRow.passed field from the run window but the excel is not updated. Am I missing something? I wanted to store to the current row's "Passed" column.


Solution

  • Solve it by using put first record of xxx

    set myExcelDB to {type:"excel", file:ResourcePath(testRunFilePath), name:"TestRun" ,writable: Yes} 
    put the records of myExcelDB into allTestRunRecords
    
    repeat with each item of allTestRunRecords
    
    put the first record of myExcelDB where ("ID") is it.ID into currentRow
    put counter into currentRow.passed 
    
    end repeat