How to identify the cell in calendar. please look at attachm

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
ranoman1
Posts: 4
Joined: Mon Sep 20, 2010 7:27 am

How to identify the cell in calendar. please look at attachm

Post by ranoman1 » Mon Dec 13, 2010 3:40 pm

Hi,

I have attached a image and in that i have to select the date from the drop down and based on the date, the calender will load and in that i have to select the cell to schedule.

The problem is when i spy and add that cell to repository, it adds the cell along with the date and time slot (which is given in the attached image at right bottom), so when i run on the specified date it is running,But when i change the date, it doesn't find that object.

The usual scenario should be current day + 1, so on any day i run the test, it should pick the specified time slot for that date.

Date selection is done. so the calender will be loaded. the task pending is to identify the cells for any specified date. please help me in finding a solution for this.?

The hierarchy in which the object is identified is also shown in the right top of the attachment,Which is table -> container-> container->cells
Attachments
req.png
req.png (41.37 KiB) Viewed 1240 times

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: How to identify the cell in calendar. please look at attachm

Post by Ciege » Mon Dec 13, 2010 4:44 pm

Not sure how familiar you are with writing your own code but that would be a/the solution here.
An inherent issue with record and playback is just what you are seeing, you have recorded an xPath to a specific object that relies on date. When the date changes, that object no longer exists.

What I would do is use your own code to craft a proper xPath to the object you want based on a specific date and time. you could write one framework method that does this for you depending on what date/time variables you pass to it. Then you have your custom xPath to the object in question.

Pseudo code:

Code: Select all

private static Ranorex.Cell ReturnCellObject(MyDate, MyTime)
{
  //Step 1 determine the date format your AUT uses based on the passed in MyDate Var
  //i.e. Sunday, December 12

  //Step 2 determine the time format your AUT uses based on the passed in MyTime Var
  //i.e. 7:00 AM

  //Step 3 Find the cell on the screen based on the passed in variables 

  //Step 4 return the Cell object if found or return NULL on an exception 
}
Now, if no exception was found, you have an object pointing to your proper cell. You can now click on it or do whatever you want with it.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

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

Re: How to identify the cell in calendar. please look at attachm

Post by Support Team » Tue Dec 14, 2010 9:33 pm

You can also use regular expressions to identify cells of e.g. a variable date but of a certain time. Just change all attribute comparisons with dates in them so they match multiple dates and point to the desired time slot. See following section in the Ranorex User Guide on how to use regular expressions in RanoreXPath:
http://www.ranorex.com/support/user-gui ... html#c2463

Regards,
Alex
Ranorex Team
.
Image