Hi,
Can anybody please help me to understand "how to select current/today's date dynamically?"
Regards,
Sunil
How to select current/today's date dynamically?
-
- Posts: 11
- Joined: Fri Jul 03, 2015 5:35 pm
Re: How to select current/today's date dynamically?
Hi,
Select where? Could you please be more specific? It would be much easier to help you with some more detailed description of your task and GUI
Ranorex Snapshot of your "date" selection GUI would be particularly useful here.
Generally speaking, you need to get the current date (via code), and then somehow select/set that date in your GUI. But it's hard to tell how without deeper knowledge of your GUI.
Select where? Could you please be more specific? It would be much easier to help you with some more detailed description of your task and GUI

Generally speaking, you need to get the current date (via code), and then somehow select/set that date in your GUI. But it's hard to tell how without deeper knowledge of your GUI.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: How to select current/today's date dynamically?
Hello Sunil,
as Odklizec has already mentioned we would need some more detailed information about the specific UI element which stores the date information.
If you take a look at the KeePass application as an example you could directly set the value of the corresponding DateTime-Element using a User Code Action.
You can get the current date of your local machine via the property System.DateTime.Now.
Regards,
Johannes
as Odklizec has already mentioned we would need some more detailed information about the specific UI element which stores the date information.
If you take a look at the KeePass application as an example you could directly set the value of the corresponding DateTime-Element using a User Code Action.
You can get the current date of your local machine via the property System.DateTime.Now.
Code: Select all
public void SetCurrentDate()
{
System.DateTime currentDate = System.DateTime.Now;
repo.EntryForm.DateTime.Element.SetAttributeValue("Value", currentDate);
}
Johannes
Re: How to select current/today's date dynamically?
As I said in the other thread, it really sounds like you need to read the user guide. http://www.ranorex.com/support/user-guide-20.html
This will explain how to use Ranorex and how to use XPath. Check it out and if you have questions after that, ask away.
Also, when you have issues, please include the following:
Ranorex version
Windows version
XPath of element, if applicable
User code, if applicable
Demo project that shows the issue
Ranorex snapshot of the element in question (note, this is NOT a screenshot)
This will explain how to use Ranorex and how to use XPath. Check it out and if you have questions after that, ask away.
Also, when you have issues, please include the following:
Ranorex version
Windows version
XPath of element, if applicable
User code, if applicable
Demo project that shows the issue
Ranorex snapshot of the element in question (note, this is NOT a screenshot)
Shortcuts usually aren't...