Micro Focus QTP (UFT) Forums
Enter new value from datatable in web edit - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Enter new value from datatable in web edit (/Thread-Enter-new-value-from-datatable-in-web-edit)



Enter new value from datatable in web edit - sonali shinde - 01-19-2012

I want enter value in web edit by using qtp. i have written script but when i was run this script again and again value will changed means i want new value in web edit, this changeable value i want enter from data table.

For Ex:

i was run script 1st time in web edit value = 1
when i was enter value 2nd time 1st value is used that's why i want change this value means enter new value when i was run this script


RE: Enter new value from datatable in web edit - anil2u - 01-20-2012

Hi,

you can enter the data in any of the data sheets available in data table and use the DataTable.Value(Parameter_ID,Sheet_ID) to call those values.

If you have qtp installed check help for more info.

Hope this helps

Anil


RE: Enter new value from datatable in web edit - sonali shinde - 01-20-2012

Thank you sir for reply to my query but i was used qtp data table which is available in qtp. and i want enter value from this data table. could u please tel me how can i use data sheet. (see my attachment file)

i will definitely check qtp help


RE: Enter new value from datatable in web edit - anil2u - 01-20-2012

What I could get from your screenshot is you are trying to read the values from the table and if the value is equal to some "text string" then you will run the test case. Hope I got this right.

For this you need to set the current row before you retrieve the value from data table not after retreiving or else use setNextRow at the end of the for loop as below:
Code:
row_count=DataTable.GetRowCount
For i=1 to row_count
   DataTable.SetCurrentRow(i) '*Sets the pointer to the ith row of the excel sheet*'
   temp=DataTable.Value("No","Global") '*Its advisable to use the sheetId or sheetName for better reading*'
   If temp="text string" then
      ***your steps***
   End If
   DataTable.SetNextRow '*Do not use this if you are using setCurrentRow method*'
Next

Hope this clarifies
Thanks


RE: Enter new value from datatable in web edit - sonali shinde - 01-21-2012

its working in my script. now i am working properly on my project.

Thank You sir.