Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to clear the contents of datatable(Local or Global sheet) during runtime?
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,

I have a script and it runs for multiple iterations . For each iteration script will capture some datas from application and the same will be kept in the local or global sheet of runtime datatable and at the end of the iteration captured data will be exported. Before starting the second iterarion I want to clear the contents in the local or Global sheet which is captured in the first iteration. Because sometime in the first iteration 50 rows of data will be there and in the second iteration there will be only 25 rows. If I export the data of second iteration it wll have the first iteration data also in the second 25 rows. So that I want to clear the contents of the datatable for each iteartion so that datatable will have the data for that particular iteration.

I know that I can add the sheet and the same can be deleted after the execution during runtime.

Is there anyway to clear the contents of the runtime datatable?

Regards,
Srini
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
There is no any direct method for this, you will have to go through each cell in data table and reset it in your script.

what I can think of another way is you can import to the an empty datasheet created earlier as template at the beginning or end of your iteration.

Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
Thanks a lot Saket.

As you mentioned I have created a template and using it. Its fine.

Regards,
Srini
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
All you need is to manually delete the data tables columns, one by one.
1-right click on first column(Example column A).
2-select "EDIT"
3- Select "Delete"
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to change the column name of datatable runtime in UFT sagar.raythatha 0 2,559 01-16-2017, 05:54 PM
Last Post: sagar.raythatha
  Verifying the contents of a Web List in QTP scipt ritugoyal 4 47,476 10-07-2016, 12:23 AM
Last Post: Vijay Kumar
Exclamation Issue with "Test run scheduler": Unable to clear the scheduler list arunshashidhar.mk 0 2,900 12-03-2013, 09:24 PM
Last Post: arunshashidhar.mk
  How to append values to the existing datatable in qtp during runtime Prashanth 1 10,663 05-01-2013, 08:30 AM
Last Post: ravi.gajul
  Creating or Renaming Column of DataTable at RunTime. Girish_Pai 6 25,982 11-15-2011, 11:08 AM
Last Post: ravi.gajul

Forum Jump:


Users browsing this thread: 1 Guest(s)