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

How can I change date in my test step?

1 Answer 39 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Yuriy
Top achievements
Rank 1
Yuriy asked on 08 May 2015, 12:05 PM

Hello, Telerik Team!

I am QA and I use TelerikTestStudio. 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.

1 Answer, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 13 May 2015, 08:31 AM
Hi 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!
Tags
General Discussions
Asked by
Yuriy
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Share this question
or