Forum Discussion
nidhi1
15 years agoOccasional Contributor
Thanks for the solution.
I was thinking of using a csv file for providing product details for an order. So, I will make my csv file containing one row of values for every order. For eg.
Ord1;Product1;Size1;Qty1;Product2;Size2;Qty2
Ord2;Product1;Size1;Qty1;Product2;Size2;Qty2
Ord3;Product1;Size1;Qty1;Product2;Size2;Qty2
Ord4;Product1;Size1;Qty1;Product2;Size2;Qty2;Product3;Size3;Qty3;Product4;Size4
Ord5;Product1;Size1;Qty1
So, inside my order data loop, I will call add_product keyword test and inside it I want to read the line from csv variable that corresponds to the order number that is being created. Then, I want to split this line based on ";" as separator and probably use a WHILE or FOR Loop to add products for that order.
Could you please provide me a way to do this in keyword test? How can I split the line from csv file? Can you provide me a javascript to do this splitting and then probably I can call this script routine inside my keyword test...
Many Thanks for your help!
-Nidhi
I was thinking of using a csv file for providing product details for an order. So, I will make my csv file containing one row of values for every order. For eg.
Ord1;Product1;Size1;Qty1;Product2;Size2;Qty2
Ord2;Product1;Size1;Qty1;Product2;Size2;Qty2
Ord3;Product1;Size1;Qty1;Product2;Size2;Qty2
Ord4;Product1;Size1;Qty1;Product2;Size2;Qty2;Product3;Size3;Qty3;Product4;Size4
Ord5;Product1;Size1;Qty1
So, inside my order data loop, I will call add_product keyword test and inside it I want to read the line from csv variable that corresponds to the order number that is being created. Then, I want to split this line based on ";" as separator and probably use a WHILE or FOR Loop to add products for that order.
Could you please provide me a way to do this in keyword test? How can I split the line from csv file? Can you provide me a javascript to do this splitting and then probably I can call this script routine inside my keyword test...
Many Thanks for your help!
-Nidhi