cancel
Showing results for 
Search instead for 
Did you mean: 

Did any one find solution to select date from date picker?

Community Hero

Re: Did any one find solution to select date from date picker?

For the most part, keep in mind, you're not testing the component itself.  It sounds like it's a pretty standard component that developers drop in.  Your goal is to test the functionality of what happens when a particular date is set.  So, setting the value is an efficient way of doing so without getting bogged down in trying to figure out how to automate the component.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
New Contributor

Re: Did any one find solution to select date from date picker?

@baxatob I tried to set the value directly using the below piece of code, it display the value in the field once this code runs, but the problem is when I navigate to next page "To find the flights for date 13 sep 19" then I cant see the result for 13 Sep 19. Instead it is showing the flight on basis of current system date. Meaning that its not storing the value which i am providing instead taking the default current date.

var departureDate=page.NativeWebObject.Find("idStr","departureDate");
  departureDate.value="13 Sep 19";

Please find the snapshot of my calender MakeBooking.PNG

 

Please help me do select the date from calender as i got stuck to move forward.

Community Hero

Re: Did any one find solution to select date from date picker?

It is possible that there is an "OnExit" event on the data field to make sure that it is updated once you set the value.  Examine the events and methods on the object to see if you can find such an event and explicitly call it after setting the value.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Community Hero

Re: Did any one find solution to select date from date picker?

Hi,

 

As I wrote initially (https://community.smartbear.com/t5/TestComplete-Functional-Web/Did-any-one-find-solution-to-select-d...), note that correct date is pre-selected in the calendar panel after you assigned the value to the text field. Thus try to confirm the date by pressing Enter for either the text field or calendar panel to confirm selection in the panel and give a chance for the page script code to perform all expected internal assignments.

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================