How are folks creating dates?

32 views
Skip to first unread message

Karen Tobo

unread,
Jul 3, 2012, 1:15:07 PM7/3/12
to selenes...@googlegroups.com
I'm making good progress developing tests with Selenesse and Slim. Now it's time to learn about using dynamic dates such as "today + 7 days", "first of next month", etc.

What are other folks doing? Is anyone using Marisa's SlimUtilities? Or maybe FitLibrary?

Thanks,

 - Karen Tobo

Chris McMahon

unread,
Jul 3, 2012, 1:23:28 PM7/3/12
to selenes...@googlegroups.com
On Tue, Jul 3, 2012 at 11:15 AM, Karen Tobo <kjt...@gmail.com> wrote:
I'm making good progress developing tests with Selenesse and Slim. Now it's time to learn about using dynamic dates such as "today + 7 days", "first of next month", etc.

What are other folks doing? Is anyone using Marisa's SlimUtilities? Or maybe FitLibrary?

While I think this is no longer possible in Selenium Webdriver, in Se1.0 you can eval javascript inline.   I don't think I have an example of using the javascript date libraries handy, I do have a similar example that generates random text:  http://chrismcmahonsblog.blogspot.com/2011/09/selenesse-trick.html

Here's another example from this list exactly one year and one day ago:

| type; | ssn | javascript{RN =
Math.floor(Math.random()*
9999999);while (String(RN).length < 8) { RN=
RN+'0';}} |
| $SSN= | getValue | ssn |
| STUFF GOES HERE ||
| type; | search | $SSN |

Karen Tobo

unread,
Jul 3, 2012, 3:32:32 PM7/3/12
to selenes...@googlegroups.com
Perfect! 

I was able to get some pointers from a team member and banged out a couple of examples:

|type;   | name=today | javascript{myDate=new Date(); displayDateString="" + (myDate.getMonth() + 1) + "/" + myDate.getDate() + "/" + myDate.getFullYear() } |
|type;   | name=plus7days | javascript{myDate=new Date(); myDate.setDate(myDate.getDate()+7); displayDateString="" + (myDate.getMonth() + 1) + "/" + myDate.getDate() + "/" + myDate.getFullYear() } |


On Tuesday, July 3, 2012 11:23:28 AM UTC-6, Chris McMahon wrote:

Chris McMahon

unread,
Jul 3, 2012, 3:42:53 PM7/3/12
to selenes...@googlegroups.com

I'd be interested to hear from anyone doing similar things with Se/Webdriver.
-Chris
Reply all
Reply to author
Forward
0 new messages