Page 1 of 1

How to clear the text of the date

Posted: Mon Sep 16, 2013 3:07 pm
by Linna
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

Re: How to clear the text of the date

Posted: Tue Sep 17, 2013 1:20 pm
by Support Team
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