Dynamic Date taken from Calendar

Class library usage, coding and language questions.
csolanki
Posts: 73
Joined: Thu Mar 22, 2018 8:51 am

Dynamic Date taken from Calendar

Post by csolanki » Tue May 08, 2018 8:26 am

Hi,

I am using system date to fill my calendar fields, I am using below mentioned code , in which I have defined StartDate and EndDate as variables.

public void GetData()
{
string start = System.DateTime.Now.Day.ToString();
string end = (System.DateTime.Now.AddDays(1).Day).ToString();

StartDate = start;
EndDate = end; }

It was working absolutely fine till last week, now suddenly it stopped working. I am not able to understand how a code can be affected by any mean ?
Still containers are same for it, which was before.

I am using date module on each page, so its breaking all of my suite test cases. Will you be able to help. Let me know, if any other detail is needed ?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3922
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Dynamic Date taken from Calendar

Post by odklizec » Wed May 09, 2018 8:10 am

Hi,

Unfortunately, there is not enough info about the actual implementation of your Ranorex test (how do you use start/enddate variables). Also, you forgot to mention Ranorex version? Ranorex snapshot (not screenshot) of the problematic element would be helpful as well. Without these details, it's next to impossible to tell what's wrong.
Pavel Kudrys
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

csolanki
Posts: 73
Joined: Thu Mar 22, 2018 8:51 am

Re: Dynamic Date taken from Calendar

Post by csolanki » Wed May 09, 2018 3:53 pm

Yep, Sorry for missing out details.

Ranorex version 8.1.0.
Machine used : Windows 10.

Problem : I have 2 calendars, in which date starts fading out as it crosses that particular date. For ex: yesterday`s date will be faded for today`s calendar drop down option. So, As a solution I chose to get system date. PFA for snapshot.
Attachments
End_Date.rxsnp
(450.74 KiB) Downloaded 9 times
Start_date.rxsnp
(445.8 KiB) Downloaded 9 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3922
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Dynamic Date taken from Calendar

Post by odklizec » Thu May 10, 2018 8:08 am

Hi,

Thanks for the additional details. Unfortunately, I still don't see how exactly are you setting the start/end date? StartDate and EndDate (in the code posted above) seems to be just variables? So how do you apply them in your solution? Are you using SetValue to pass the variables directly to startDate-container/stopDate-container? In my opinion, you will first have to click the container, to display the date picker, and then select the date from the appeared date picker. Setting date directly to container may fail, because of possible onmouse/onkey or similar event, attached to the date picker container? If your code/recording worked before and all of suddenly it stopped, then it's most probably because your dev guys changed something in the date pickers?
Pavel Kudrys
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

csolanki
Posts: 73
Joined: Thu Mar 22, 2018 8:51 am

Re: Dynamic Date taken from Calendar

Post by csolanki » Fri May 11, 2018 7:21 am

Hey,

Thanks I got the solution.

Thanks.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3922
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Dynamic Date taken from Calendar

Post by odklizec » Fri May 11, 2018 7:50 am

Hi, nice to hear you found a solution! Any chance you could share it with the rest of gang? ;) It may help someone else stumbling around similar problem. Thanks.
Pavel Kudrys
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

csolanki
Posts: 73
Joined: Thu Mar 22, 2018 8:51 am

Re: Dynamic Date taken from Calendar

Post by csolanki » Tue May 22, 2018 10:13 am

Sure, But I did not take system`s date anymore because Ranorex was behaving different each time as I told earlier. Solution I got, is with variables , I have created 2 variables with start date and end date(Using DDT) but without doing any change in code.

Thanks.