Forum Discussion
Hi Abhay,
Visually, your calendar controls look like those I worked with, so I hope that my suggestion may work for you. Try to assign the date (as per my example) to the first control, click on it to open the calendar, press Enter to confirm the date and assign then the needed value to the second control. Maybe, this will work.
As a side note and according to my understanding of the screenshot you have provided: I see some potential usability problem here - the first control is constantly used to enter values to it and another control (Checkout one). If I, as a user, would like to correct the checkout date, I must understand that I need to enter the first control, leave its date as it is and correct only the second date. Seems to be not very intuitive and error prone, as the initial date may be changed occasionally and this change may left not noticed. Isn't it better to discuss the possibility to make both controls to be editable? In addition to improved usability, this may make your life easier as well because it will be possible to set data to both controls independently.
Hi Abhay,
Another possible solution is to find a JavaScript function to setup a date directly.
- AlexKaras8 years agoCommunity Hero
Really sorry for jumping-in, but can't withstand to extend your reply a bit (in square brackets):
Another possible solution is to find [on the page] a JavaScript function to setup a date [and call this function] directly [as described here: http://support.smartbear.com/testcomplete/docs/app-testing/web/general/common-tasks/javascript.html].
- Abhay_Kulkarni8 years agoNew Contributor
Sorry for late response.
But it did not work. But If I write below command in developer tool's console window then it works on browser.
document.getElementById('txtDepartureDate').value = "08/03/2017"
Is it possible to write above Javascript statement into my VBScript Project of TestComplete?
On link https://support.smartbear.com/testcomplete/docs/app-testing/web/general/common-tasks/javascript.html there is solution to run javascript function exist in Application Under Test. How can I execute javascript statement?
Thanks,
Abhay Kulkarni
- baxatob8 years agoCommunity Hero
Hi,
Try to set the value directly. E.g.:
Aliases.browser.yourTargetElement.value = "08/03/2017" where yourTargetElement is the mapped name
of the element with id "txtDepartureDate"