retrieve values from 2 time components

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
bsing
Posts: 81
Joined: Tue Feb 07, 2012 5:25 am

retrieve values from 2 time components

Post by bsing » Mon Feb 27, 2012 12:47 am

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.
Attachments
listTime.png
listTime.png (538 Bytes) Viewed 944 times

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

Re: retrieve values from 2 time components

Post by Support Team » Mon Feb 27, 2012 2:14 pm

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
.
Image

bsing
Posts: 81
Joined: Tue Feb 07, 2012 5:25 am

Re: retrieve values from 2 time components

Post by bsing » Wed Feb 29, 2012 6:34 am

Attached snapshot.
Attachments
timeFieldStructure.rxsnp
(272.24 KiB) Downloaded 171 times

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

Re: retrieve values from 2 time components

Post by Support Team » Wed Feb 29, 2012 12:20 pm

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
.
Image

bsing
Posts: 81
Joined: Tue Feb 07, 2012 5:25 am

Re: retrieve values from 2 time components

Post by bsing » Thu Mar 01, 2012 12:02 am

cannot see all of your code until I post something again.

bsing
Posts: 81
Joined: Tue Feb 07, 2012 5:25 am

Re: retrieve values from 2 time components

Post by bsing » Thu Mar 01, 2012 12:49 am

This is brilliant! - thankyou.