2

I'm having a scenario to test where I have to simulate 3 months ahead from the current date. (Because after 3 months some items on my test web system should disappear.)

I tried changing system DateTime, But it does not work. There will be an OS-level exception when trying to access the web page with future system date time.

Is there any way to do this?

Error on the web page after system time set for a future date.enter image description here

7
  • Are you able to amend the items on your test system to appear as if they were created 3 months ago? E.g. by amending some created date or something?
    – Moorpheus
    Jan 15 at 10:18
  • Nope the system does not allow adding the past dates
    – ChathuD
    Jan 15 at 10:19
  • what was the os level exception please add that
    – PDHide
    Jan 15 at 11:21
  • @PDHide I have added an image.
    – ChathuD
    Jan 15 at 14:01
  • is the webpage loaded on localhost ?
    – PDHide
    Jan 15 at 16:31
1

This is not any OS error , this is just certififcate error .

You can use firefox which allow to ignore insecure certificate.

You can also ignore certificate error in chrome by starting chrome with below flags:

"C:\Program Files\Google\Chrome\Application\chrome.exe" --ignore-certificate-errors --ignore-urlfetcher-cert-requests

Note close all chrome instance before running chrome with above flag then only it works

enter image description here

1
  • Cool. This was working fine.Thanks,
    – ChathuD
    Jan 20 at 11:26
4

This is where you get imaginative.

Some of your options are:

  • Edit the data behind the system - If you have access to the database or data source your test system is using, you can edit the underlying data to expire "tomorrow".
  • Change the cycle length - If you have the ability to change the length of time the items are active, make them active for a day rather than 3 months. What you're testing isn't so much the expiry time as the system properly handling the expiry.
  • Set up rolling expiry dates - This is more a long-term regression situation: you set up a series of items that will expire the normal way, but you have them created so that every day, one of them expires. If you name them by their expiry date, you can tell if anything is present when it shouldn't be.
  • Ask the devs to set up short-expiry items for you - This is the option to use if you don't have the permissions or access to edit underlying data directly or change settings. Somewhere in the system there is code to expire these items in 3 months, so you ask if they can give you a special-use version of the system that has a 1 day expiry instead of a 3 month expiry. You'll probably need to explain why you need this, but you should be able to get your special test version to test expiry, since the alternative appears to be "set it up and wait 3 months".

If the test system is hosted on your machine and can run on your machine without internet connectivity, you may be able to have it work by changing the system date with the network/internet turned off, but there are so many other interdependencies that I wouldn't be surprised if that still failed.

0

This is one of the typical time-related scenarios where we need to perform testing with a future timeline.

Usually, software testing services follow the approach to update the application's server or database time (which is responsible for the application's current time zone settings) to verify these time-bounded scenarios.

On the other hand, instead of changing the server's timezone, we can also decrease the three months duration to a shorter one on local/testing environments to test the scenario more reliably and similar to a real-time situation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.