Page 1 of 1

retrieve values from 2 time components

Posted: Mon Feb 27, 2012 12:47 am
by bsing
Hi,

I want to know how I can retrieve the value (time) listed in time fields on a form.

Here is the path to the first time field (which is a list) on the form:

/form[@controlname='frmMain']/container[@controlname='cwtcMain']/container/container[@controlname='pnlSearch']/container[@controlname='dtFrom']/datetime[@controlname='dtpTime']/list[@accessiblename='8:32 AM']

The list is embedded in the datetime field.

Have attached a visual of it.

Re: retrieve values from 2 time components

Posted: Mon Feb 27, 2012 2:14 pm
by Support Team
Hi,
bsing wrote:I want to know how I can retrieve the value (time) listed in time fields on a form.
Would it be possible to post us a Ranorex Snapshot for further information?
How to create a Ranorex Snapshot
With this snapshot we can show you a way to retrieve the value of your date field.

Regards,
Peter
Ranorex Team

Re: retrieve values from 2 time components

Posted: Wed Feb 29, 2012 6:34 am
by bsing
Attached snapshot.

Re: retrieve values from 2 time components

Posted: Wed Feb 29, 2012 12:20 pm
by Support Team
Hi,

you can use following code snippet to log out the time value held by the list item:
List your_time = "/form[@controlname='frmMain']/container[@controlname='cwtcMain']/container[2]/container[@controlname='pnlSearch']/container[@controlname='dtFrom']/datetime[@controlname='dtpTime']/list";
Report.Info(your_time.Element.GetAttributeValue("Accessiblename").ToString());
Regards,
Tobias
Ranorex Support Team

Re: retrieve values from 2 time components

Posted: Thu Mar 01, 2012 12:02 am
by bsing
cannot see all of your code until I post something again.

Re: retrieve values from 2 time components

Posted: Thu Mar 01, 2012 12:49 am
by bsing
This is brilliant! - thankyou.