2018 up to now | 2017 | 2016 | 2015 | 2014 | 2013 | 2012

Mailing List - Entries of 2012


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [QF-Test] Change system date


  • Subject: Re: [QF-Test] Change system date
  • From: Michael Höber, QFS Support <support@?.de>
  • Date: Mon, 22 Oct 2012 10:01:01 +0200

Hello Chris,

 

on Windows XP and newer you can simply get and set the system date and time.

To get the current date/time please insert an 'Execute shell command' node with one of the following commands:

date /T

time /T

After execution of this node its output is saved at the QF-Test variable ${qftest:client.output.<name>} where <name> is the name of the defined client at the 'Execute shell command' node. To retrieve its value please use rc.lookup("qftest", "client.output.<name>") because the output contains a line break.

To set the date/time use one of the following commands:

date TT-MM-JJ

time hh:mm

For example if you want to change the date and time to 01-15-2012 20:00 add an 'Execute shell command' with the command 'date 01-15-2012' followed by another 'Execute shell command' with 'time 20:00'.

 

Please note: On Windows Vista and newer setting the system date/time requires an elevated access token. That means that QF-Test itself has to be started with administrative privileges (or UAC has to be deactivated).

 

Best regards,

     Michael

 

--

Get the most out of QF-Test - through training directly from the authors

* via webinar       http://www.qfs.de/en/info/OnlineTraining_QF-Test.pdf

* here at QFS             http://www.qfs.de/en/info/Training_QF-Test.pdf

------------------------------------------------------------------------

QFS Support - Michael Hoeber            

Quality First Software GmbH                http://www.qfs.de

Tulpenstr. 41                         Tel: +49 8171 38648-20

DE-82538 Geretsried                   Fax: +49 8171 38648-16

GF: Gregor Schmid, Karlheinz Kellerer     HRB München 140833

 

 

From: qftest-list-bounces@?.de [mailto:qftest-list-bounces@?.de] On Behalf Of Christopher.Stanbridge@?.au
Sent: Monday, October 22, 2012 4:22 AM
To: qftest-list@?.de
Subject: [QF-Test] Change system date

 

Hi,

 

I’m looking to change the system date and time on my windows 7 machine. I have a test that checks the application under tests handles this correctly, but I’d like to do it in the course of an automated test run, then change it back before proceeding with other tests.

Anyone done this already and are feeling charitable?

 

Thanks in advance!

 

Chris