Using CSV file for data

Hello,

I have a CSV file with 10 000 codes. (1 row with 10000 different codes). I know how to use the file for specific rows or random rows data on tests, but I would like to delete a row data after being used on a test (Because I can only use each code once). Is that possible?

Thank you in advance.

Miguel Morgado

Hi @miguel.morgado,
You can use the ‘Get value from a CSV file using specific row and column’ action to get the value to a parameter and use it.
Then, use the ‘Delete a column from a CSV file by index’ action to delete the code you used.

Let me know if this solution helps you.

Hi @ran.ferdinaro

Thank you for your answer.

Instead of deleting a column, I would rather delete just a row. Is there a way to do that?

Thank you

Miguel Morgado

Hi @miguel.morgado,
Try to use the ‘Update CSV file entire row’ action and leave ‘UpdateValue’ empty.
It will clean the row.

@ran.ferdinaro

That is exactly what I did and it cleaned the entire row, but the row is still there as empty.

image

The problem is that, after the row is empty, but still there, the next time the test runs, is expecting row 2 to have content.
(If the row was deleted, the row 3 would become row 2 automatically, and so on).

Hi @miguel.morgado,
I have created an improvement request for an add-on to delete a row from a CSV file.
Ticket number TP17262
You will get notified once it’s resolved.

Meanwhile you can create a project parameter with a row value, and after using the ‘Get value from a CSV file using specific row and column’ action add a step with the 'Evaluate Mathematical Expression action to increment the parameter’s value by 1.

Hello @ran.ferdinaro
I have a subscription on Browserstack, but I have this error when I try to use an emulator from there:
My subscription do no have the “Automate”.
Can that be the cause? Thank you
Screenshot_2