Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
datatable Help
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
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.)
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
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?
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
Thanks for response, it's working fine.
Reply
#4
Solved: 11 Years, 3 Months, 4 Weeks ago
What I did was changed excel settings by going to Tools->options->Error Checking tab-> third check box "number stored as text"
Reply
#5
Solved: 11 Years, 3 Months, 4 Weeks ago
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Datatable add and datatable import sheet wheelercha 4 33,634 06-14-2012, 04:53 PM
Last Post: Arul

Forum Jump:


Users browsing this thread: 1 Guest(s)