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
How to identify the cell in calendar. please look at attachm
How to identify the cell in calendar. please look at attachm
You do not have the required permissions to view the files attached to this post.
Re: How to identify the cell in calendar. please look at attachm
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:
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.
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
}
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...
Ciege...
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: How to identify the cell in calendar. please look at attachm
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
http://www.ranorex.com/support/user-gui ... html#c2463
Regards,
Alex
Ranorex Team