Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP11.0 - Date format is changed as text while executing the QTP script.
#1
Not Solved
Hi,

I am using QTP11.0.
I am using extenal file[excel] for testdata.
In one of my scripts, in excel, for one cell i used the formula for date.
the date format is "=Now()+"2:30"

This formula first i tried in testdata file. few days it works fine.after that i did not work well. then I gave the same date fromula in test script file[excel] it self.

when we open the file and see it shows as date .But In both cases it is changed as text while executing the QTP scripts. the cell data shows as "Hide 158".

I tried in different ways. but no luck.

If any body knows the solution please post the answer.

Thanks in Advance...
Reply
#2
Not Solved
Hi Automation Tester,

1. you should format and set the entire column for the time as a particular format like HH:MM or HH:MM:SS like that.
2. Always have the same format as of your system date and time format, you can change it from the Control panel and regional settings.

That being said, you can also add the time in the following way.
DateAdd(interval,number,date)
yyyy - Year
q - Quarter
m - Month
y - Day of year
d - Day
w - Weekday
ww - Week of year
h - Hour
n - Minute
s - Second

adding the time in the above manner will get you rid of the issues.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  error when executing an UFT automation script alexalloza 0 1,398 10-30-2018, 06:17 PM
Last Post: alexalloza
  swfwindow object name getting changed after each run saniya 1 1,488 10-10-2018, 09:02 PM
Last Post: TheGlovner
  How to append date to xls file using qtp datatable methods? yona34 1 1,468 05-04-2018, 08:56 PM
Last Post: Ankur
  Executing via create "RES"xx folder? nishitd 0 1,113 03-07-2018, 01:09 AM
Last Post: nishitd
  QTP not recognizing date calendar kQTPs 1 3,457 12-20-2017, 11:21 PM
Last Post: harikrishna

Forum Jump:


Users browsing this thread: 1 Guest(s)