This is a migrated thread and some comments may be shown as answers.

How can I change date in my test step?

3 Answers 48 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Yuriy
Top achievements
Rank 1
Yuriy asked on 08 May 2015, 09:32 AM

Hello, Telerik Team!

I am QA. I am trying to create test step where date will be = current date + some  days.

When I recorded test I chose required date. But if I will execute same test tomorrow - date will be wrong.

Unfortunately, I don't have programming skills.

Date format - 5/8/2015 (m/d/yyyy)

Looking forward on your response. 

 

3 Answers, 1 is accepted

Sort by
0
Accepted
Boyan Boev
Telerik team
answered on 13 May 2015, 08:29 AM
Hello Yuriy,

This can be done in a coded step.

Here is a code example which takes the current date and convert it to string in dd/mm/yyyy format:

DateTime today = DateTime.Today;
string currentDay = today.ToString("dd/MM/yyyy");

Let me know if this helps.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Yuriy
Top achievements
Rank 1
answered on 13 May 2015, 09:38 AM

Hello, Boyan!

By means of your example I was able create test step which I need !

 Also I understood how can I change date:

           today = today.AddDays(2);

 

Thank you for your help!

 

0
Boyan Boev
Telerik team
answered on 14 May 2015, 10:10 AM
Hello Yuriy,

I am happy to hear that.

If you need further help please let us know.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Yuriy
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Yuriy
Top achievements
Rank 1
Share this question
or