Desmond_Cassidy
17 years agoContributor
Creating Propertiues at the Project level...
Hi,
Apologies if this is covered in some other place...or more to the point - where in the Groovy Guid eare the basics of Property creation specified.
I would like to dynamically create several named properties at either
1. The Project Level
2. The Suite Level
(THere doesn;t seem to be the possiblility of creating Global Properties - not that I can see anyway).
So, in One Groovy Script I would like something like...
import java.text.*;
SimpleDateFormat df1 = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat df2 = new SimpleDateFormat("HH:mm:ss.S");
String TodayPlus14 = df1.format( new Date() +14;) + "T" + df2.format( new Date() +14; );
String TodayPlus21 = df1.format( new Date() +21;) + "T" + df2.format( new Date() +21; );
...and now create (and I guess a check to see if the property is already defined - as in a Re-Reun!) and load properties like TodayPlus14, TodayPlus21 (OK..the ame name but doesn;t have to be !). ...into either the Project , Test Suite or indeed Global level...
Not being a java programmer...all this seems a little obtuse to me...
Any help appreciated...
Cheers,
Dezzz.
Apologies if this is covered in some other place...or more to the point - where in the Groovy Guid eare the basics of Property creation specified.
I would like to dynamically create several named properties at either
1. The Project Level
2. The Suite Level
(THere doesn;t seem to be the possiblility of creating Global Properties - not that I can see anyway).
So, in One Groovy Script I would like something like...
import java.text.*;
SimpleDateFormat df1 = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat df2 = new SimpleDateFormat("HH:mm:ss.S");
String TodayPlus14 = df1.format( new Date() +14;) + "T" + df2.format( new Date() +14; );
String TodayPlus21 = df1.format( new Date() +21;) + "T" + df2.format( new Date() +21; );
...and now create (and I guess a check to see if the property is already defined - as in a Re-Reun!) and load properties like TodayPlus14, TodayPlus21 (OK..the ame name but doesn;t have to be !). ...into either the Project , Test Suite or indeed Global level...
Not being a java programmer...all this seems a little obtuse to me...
Any help appreciated...
Cheers,
Dezzz.