How to clear the text of the date

Ask general questions here.
Linna
Posts: 6
Joined: Tue Jun 18, 2013 9:52 am

How to clear the text of the date

Post by Linna » Mon Sep 16, 2013 3:07 pm

Hi,
I wonder how to clear the text of the date.I try to two method.It doesn't work.
one method:
Ranorex.Control conDate1="/form[@controlname='FrmMain']/element[@controltypename='MdiClient']/form[@controlname='FrmBasHR_PersonnelFile']/container/container[@controlname='splitHorizontal']/container[@controlname='panel1']/container[@controlname='pnlGrid']/container[@controlname='splitControl']/container[@controlname='panel1']/container[@controlname='pnlListTop']/element[@controlname='dte_RZDate' and @controltypename='DateEdit']";
conDate1.Element.SetAttributeValue("ControlText","");
This method is not clearing the text of date.
the other method:
Ranorex.Text txtDate1="/form[@controlname='FrmMain']/element[@controltypename='MdiClient']/form[@controlname='FrmBasHR_PersonnelFile']/container/container[@controlname='splitHorizontal']/container[@controlname='panel1']/container[@controlname='pnlGrid']/container[@controlname='splitControl']/container[@controlname='panel1']/container[@controlname='pnlListTop']/element[@controlname='dte_RZDate']/text[@controltypename='TextBoxMaskBox']";
txtDate1.DoubleClick();
txtDate1.PressKeys("Delete");
This method could clear selected date,but it will show current date.Who can help me?


Best regards
Linna

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to clear the text of the date

Post by Support Team » Tue Sep 17, 2013 1:20 pm

Hi,

How do you normally (without the use of Ranorex) clear the text of the date field?
May I ask you to post a screenshot of the specific element?

Thanks,
Markus
.
Image