QTP Function Question

In my interview, I was given a screen shot for user name, password, date, transfer amount etc and was asked to write as many test cases as possible in terms of qtp.
I don't know how to write function to check the date. Please some one help with some sample test cases that are used in real time QTP. Thank you so much in advance.

Questions by puja123

Showing Answers 1 - 12 of 12 Answers

rpk

  • Mar 2nd, 2007
 

To write function for date, first you should be clear whether the date field is scroll edit box or simply edit box.

if it is simply edit box for date then

 object hierachy.vbedit('date").set "21-10-2006"  ( date should be based on the date format of your application) 

if it is scroll edit box box then

object hierachy.vbedit("date").select ......(keep the desired date)

  Was this answer useful?  Yes

puja

  • Mar 5th, 2007
 

But my question is what if someone enter 2/31/2007, how do we use right function for that to check that is not valid date.

  Was this answer useful?  Yes

gvssumankumar

  • Mar 9th, 2007
 

if we take the date field u check the whether it is combobox or text box.in the case of text box if u enter the date in that field .in qtp we write in vbedit(), if date is in combo box we can write in vblist().

  Was this answer useful?  Yes

mm.achar

  • Mar 12th, 2007
 

First capture the value of date that has been entered or selected. This can be done by date_var = Editbox.GetROProperty("text) or date_var = Combobox.GetROProperty("text)

Then use the function isdate(date_var). This will give true or false output if the date is present in the date_var

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions