Odin Technology - Automated Software Testing

Axe Test Automation Platform

General discussion relating to the Axe Test Automation Platform from Odin Technology

Posts by Odin employees marked:

Find end of month and enter into text field

Hi

I have a situation where I need to get the value of a Date field and enter the end date of the same month in another text field. I have tried to find solutions to this but I cannot enter the end date into the second field. I am working in Selenium c# and Axe 3.5.1. The code below is from my Action Map:

string s = String.Format("{0}",axe.DataLoad("%OBJECT%", "%PARAM1%"));
string[] words = s.Split('/');
int day = Int32.Parse(words[0]);
int month = Int32.Parse(words[1]);
int year = Int32.Parse(words[2]);
int lastDay = (int)DateTime.DaysInMonth(year,month); string lastDate = System.String.Format("{0}/{1}/{2}",lastDay,month,year);
axe.Data=lastDate;

Can anyone assist?

Thanks

Jon
Jon Alsop Send private email
Thursday, June 20, 2013
 
 
You need to have two separate functions in the Action Map or custom library:

1. An action for the get (which also incorporates a 'save' function (check axe documentation as there is a standard function))
2.A set action which first loads the date and sets to the last working day

In a subtest then place the 'getDate' function against the relevant object and 'setLastDayOfMonth' against the field to enter the data into.

Hope this helps

Mark
Mark Winspear Send private email
Wednesday, August 14, 2013
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics