Micro Focus QTP (UFT) Forums
datatable Help - 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: datatable Help (/Thread-datatable-Help)



datatable Help - newqtp - 02-14-2013

I have a code where I have to enter 0231 with zero as 1st digit. However qtp insert value as 231 in that field and my script fails. is there any solution to force qtp to insert 0231, 0 as the first digit?
See Below:
Code:
Browser(".*").Page(".*).Webedit("Name:=User.*).set datatable("username", dtglobal)
Browser(".*").Page(".*).Webedit("name:= ssn.*).set datatable("ssn", dtglobal)

datatable as
username ssn
test 1234
second 3231
third 0231
fourth 2311

at third iteration script fails as while importing the script ssn column value becomes 231 and that field need four digit value (number.)


RE: datatable Help - basanth27 - 02-14-2013

Is that because on your datatable the value stored is in the format of number and not of string? try this, While storing the value store as '0231
Make a special note of aphostaphe..
Helps?


RE: datatable Help - newqtp - 02-15-2013

Thanks for response, it's working fine.


RE: datatable Help - newqtp - 02-15-2013

What I did was changed excel settings by going to Tools->options->Error Checking tab-> third check box "number stored as text"


RE: datatable Help - vinod123 - 02-18-2013

It is the Problem with the excel sheet but not with qtp so format the excel by selecting the column and right click on it and select format cells and select the option text it will solve your problem