This is a migrated thread and some comments may be shown as answers.

Handle Date Picker/Calender Conrtol

17 Answers 245 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
N1t1nA
Top achievements
Rank 1
N1t1nA asked on 27 Apr 2011, 06:54 AM
Hi
How to handle the Data Picker/Calender Control using WebUI Dev Edition
What should be the Coded Step for accessing the DD/MM/YYYY using Date Picker.

Thanks

17 Answers, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 28 Apr 2011, 12:37 PM
Hi Nitin,
    why do you need to automate this Control with code. Test Studio is designed to keep coding to a minimum. I'm curious as to why you need to use code only. Creating a test with Test Studio's recorder (no coding involved) will save you a lot of time and effort.

Kind regards,
Stoich
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
N1t1nA
Top achievements
Rank 1
answered on 28 Apr 2011, 01:22 PM
Hi
Actually I am creating Testing Framework

I want to do this by Coding only (No Record and PlayBack method).
Like for Caleder Control I want to Do validation for Invalid Date types and only way is to Hanlde through Coded Step
0
Pavel
Telerik team
answered on 04 May 2011, 12:02 PM
Hello Nitin,
    
Could you elaborate what is the exact scenario you want to test? If you provide a live url with the page you need to automate and more details about what actions you need to execute or what values need to verify, we will be able to give you more specific directions on how to proceed.

Kind regards,
Pavel
the Telerik team
Do you think you know all the new features coming out in Test Studio R1 2011? Think again - we have some surprises and will share them with you in the What's New in Test Studio R1 2011 Webinar on May 12th.
Register Today!
0
N1t1nA
Top achievements
Rank 1
answered on 06 May 2011, 01:04 PM

Hello Pavel

I want to Set the Date (Valid from and Valid To) acording to my requirements for Specific User, also I want Validations like "Start date cannot be after end date"
When I Use Recording method, The Calender Control is Recognized as below:-

// Click 'ContentplaceholderPaymentTermValidityValidFromOpenCalendarDialogButton'
        Pages.AUT.FrameApplicationframe.ContentplaceholderPaymentTermValidityValidFromOpenCalendarDialogButton.Click(false);
// Click 'x10Link'
        Pages.AUT.FrameApplicationframe.x10Link.Click(false);
// Click 'ContentplaceholderPaymentTermValidityValidToOpenCalendarDialogButton'
       Pages.AUT.FrameApplicationframe.ContentplaceholderPaymentTermValidityValidToOpenCalendarDialogButton.Click(false);
// Click 'x27Link'
       Pages.AUT.FrameApplicationframe.x27Link.Click(false);

I want to write the Coded Step to Enter Valid from date say ( 10 May 2009) and Valid To date say ( 10 May 2011), These Dates may vary for different User requirements

Also this would help if i want to Modify date only, No need to Record again the Same Case for only Date Changes.

0
Pavel
Telerik team
answered on 06 May 2011, 01:56 PM
Hi Nitin,

Is the code you provided generated after you have recorded the clicks in test studio? Unfortunately I am still not able to advise you, as I do not have the page you are trying to test and thus I am not aware of the generated html you need to manipulate. Are you testing an instance of RadCalendar/RadDatePicker, or is it some other control?

Regards,
Pavel
the Telerik team
Do you think you know all the new features coming out in Test Studio R1 2011? Think again - we have some surprises and will share them with you in the What's New in Test Studio R1 2011 Webinar on May 12th.
Register Today!
0
N1t1nA
Top achievements
Rank 1
answered on 09 May 2011, 08:10 AM
Yes
This Code appears after Recording in Test Studio

Here is Code appears in Pages.g file when I add Calender Control Elements (Open Calender Control, Select Date, Select Month, Navigations keys for Changing months) one by one.

here is the File as Attachment <<Pages.g.cs>>

These are not a part of RadCalendar/RadDatePicker, these are part of .net calender control.
0
N1t1nA
Top achievements
Rank 1
answered on 09 May 2011, 08:20 AM
Also, I am having one more question

if I want to add @Today's date into Valid from field, How do I pick it from Windows Calender control.  
0
Pavel
Telerik team
answered on 09 May 2011, 12:38 PM
Hi Nitin,

I have prepared a simple test which is running against this page. Let me know if that helps.

Kind regards,
Pavel
the Telerik team
Do you think you know all the new features coming out in Test Studio R1 2011? Think again - we have some surprises and will share them with you in the What's New in Test Studio R1 2011 Webinar on May 12th.
Register Today!
0
N1t1nA
Top achievements
Rank 1
answered on 12 May 2011, 06:38 AM

Hi
This Solution is for ASP.Net AJAX control, but in my Application Custom Calender Control is Used

If i select the Next Month through Navigation Keys > then it is recognized as:-

public ArtOfTest.WebAii.Controls.HtmlControls.HtmlImage WebResourceAxdDWy5yaGUgbh8XmnKNqiUU0rZpHde9eBAzi9MFUR1hdlcjmiGXcoxBgPS28b0NbGULXc3Lqx867dg5cPLC03LgDGJfl0XQooS8243FN0DXG3s6beaKyeggJL0xlboYEn6GDcXjGE28GiLszSYlxCvRUczcOm6Glj2dWYeVgRmKmcDf0AmpT634406742840000000Image
                {
                    get
                    {
                        return Get<ArtOfTest.WebAii.Controls.HtmlControls.HtmlImage>("src=http://Machine5072:81/App/WebResource.axd?d=-wy5yaGUgbh8XmnKNqiUU0rZpHde9eB" +
                                "Azi9MFUR1hdlcjmiGXcoxBgPS28b0NbGULXc3Lqx867dg5cPLC03Lg-dGJfl0XQooS8243FN0DXG3s6b" +
                                "eaKyeggJL0xlboYEn6GDc-xjGE28GiLszSYlx-cvRUczcOm6Glj2dWYeVgRmKmcDf0&amp;t=6344067" +
                                "42840000000", "tagname=img");
                    }
                }

When I select the Date, it is recognized as:-

                /// Find logic
                /// (Html): [tagname 'Exact' a] AND [TextContent 'Exact' 12]
                ///
                /// </summary>
                public ArtOfTest.WebAii.Controls.HtmlControls.HtmlAnchor x12Link
                {
                    get
                    {
                        return Get<ArtOfTest.WebAii.Controls.HtmlControls.HtmlAnchor>("TextContent=12", "tagname=a");
                    }
                }
How to Automate this or should I enter date manually in textboxes:(

0
N1t1nA
Top achievements
Rank 1
answered on 12 May 2011, 07:13 AM
Hi, I am attaching Quick Video to show, what exactly is my Requirement.

Hope this Helps.
0
Pavel
Telerik team
answered on 13 May 2011, 08:13 AM
Hi Nitin,

As explained previously, it is not possible to create a coded test without having the actual html output of the page in question. That is why I sent you a sample against a publicly available page, on which you can comment.

Regards,
Pavel
the Telerik team
Do you think you know all the new features coming out in Test Studio R1 2011? Think again - we have some surprises and will share them with you in the What's New in Test Studio R1 2011 Webinar on May 12th.
Register Today!
0
Habiba
Top achievements
Rank 1
answered on 31 Oct 2018, 05:36 AM
how Can record a date form datevpicker in test studio?
0
Elena
Telerik team
answered on 06 Nov 2018, 01:06 PM
Hello Habiba,

Test Studio allows you to highlight any element on a page and add steps against it while in recording mode. Please try to add the necessary steps with the help of the elements menu - possibly you might need to locate the element in the DOM tree and then manually add the steps from step builder in the recording toolbar. Depending on the exact variation of the datepicker, you should be able to directly enter the desired date in the input filed. 

In case the above information is insufficient and you need further assistance, please prepare a sample for the datepicker you need to automate along with the scenario to cover and what difficulties you are facing. That way I will be able to provide more exact advice based on the particular case. 

Thanks in advance. 

Regards,
Elena Tsvetkova
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Shanmugaraju
Top achievements
Rank 1
answered on 19 Nov 2019, 12:49 PM

Hi,

 

How to handle Date picker in telerik test studio with recording mode,i need date 25/02/2018 (MM/DD/YYYY)

I our application using date picker i am picked the date for the particular date from the date picker.

Kindly do the needful.

0
Elena
Telerik team
answered on 21 Nov 2019, 08:50 AM

Hi Shanmugaraju,

The date picker control has its specifics and these need to be taken into account when automating such. 

Using the calendar to select the desired date may be applicable in some scenarios if using data driven approach. This is because the displayed month is different depending on the current date. 

However, when you need to enter an exact date by each test execution, it will be best to enter this manually as text in the input field of the calendar control.

Please, give this a try and let me know if it works fine for the date picker you are automating. In case you face any troubles, please, let me know if you can share access to the application under test and demonstrate the control, or alternatively, you can prepare a test to show the issue against a demo page using the same control. 

Thank you for your cooperation in advance.

Regards,
Elena
Progress Telerik

 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
john
Top achievements
Rank 1
answered on 31 Jul 2020, 07:36 AM
THX,that's useful
0
Elena
Telerik team
answered on 31 Jul 2020, 02:31 PM

Hi John,

I am pleased to know you find these notes helpful! 

Regards,
Elena
Progress Telerik

Tags
General Discussions
Asked by
N1t1nA
Top achievements
Rank 1
Answers by
Stoich
Telerik team
N1t1nA
Top achievements
Rank 1
Pavel
Telerik team
Habiba
Top achievements
Rank 1
Elena
Telerik team
Shanmugaraju
Top achievements
Rank 1
john
Top achievements
Rank 1
Share this question
or