Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
You can author and run a Selenium IDE test that records a timestamp, but Selenium IDE’s documented built-in commands do not include a command to save a screenshot file. For a repeatable PNG with a timestamp in its filename, use Selenium IDE to sequence the test, then capture through a Selenium WebDriver runtime: generate an ISO timestamp immediately before the screenshot call, replace filename-unsafe colons, and save to a known artifact directory. Keep the original ISO value in the test log when exact time and timezone matter.
What Selenium IDE can and cannot do
Selenium IDE is a browser extension for recording and playing back tests. Projects are saved as .side files, and tests can also be run cross-browser from the command line. The official command catalog documents execute script, which can run JavaScript and store a returned value, but it does not document a built-in screenshot-to-file command. Selenium IDE command reference Selenium IDE getting started
That distinction matters: a timestamp variable in an IDE test is not by itself a PNG artifact, nor does it set a filename. To control the actual file path and name, use Selenium WebDriver’s screenshot API in the runtime that executes the test. Python’s WebDriver API provides save_screenshot and get_screenshot_as_file; the filename must end in .png. Python WebDriver API
Record the timestamp in Selenium IDE
-
Open Selenium IDE, create or open a project, and record the navigation and assertions as usual. You can also enter commands manually. Save the project as a
.sidefile.#1 Best Overall
SalePhilips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
-
At the point immediately before the screenshot boundary, add an
execute scriptcommand. Set its script to:return new Date().toISOString(); -
Set the command’s
valuefield tocaptureIsoso the returned timestamp is stored for use by the test. The command reference describes storing returned script values through the value field. -
Export or run the test in a WebDriver binding and pass the stored timestamp to the screenshot step. If the export/runtime does not expose the IDE variable in a directly usable form, generate the timestamp again in the runtime immediately before capture; this most closely represents the capture event.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
toISOString() produces an ISO 8601 UTC timestamp, for example 2026-09-29T14:05:06.123Z. Colons are unsuitable in filenames on some operating systems, so use a safe derivative for the filename and preserve the untouched ISO string in logs or metadata. A filesystem modification time is not a substitute for the test event time.
Capture a timestamped PNG with Python WebDriver
The following capture function creates a safe filename token from the current UTC time, writes to a known directory, checks the result, and returns both the path and original ISO timestamp. Create the artifact directory before calling it.
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
from datetime import datetime, timezone
from pathlib import Path
def capture_timestamped_png(driver, artifact_dir="artifacts", test_name="checkout"):
output_dir = Path(artifact_dir).resolve()
output_dir.mkdir(parents=True, exist_ok=True)
# Generate the event timestamp immediately before capture.
capture_iso = datetime.now(timezone.utc).isoformat(timespec="milliseconds")
# Keep the filename portable; retain capture_iso unchanged in logs.
stamp = capture_iso.replace(":", "-")
output_path = output_dir / f"{test_name}-{stamp}.png"
success = driver.save_screenshot(str(output_path))
if not success or not output_path.is_file():
raise RuntimeError(f"Screenshot capture failed: {output_path}")
return {"path": str(output_path), "capture_iso": capture_iso}
# Example, after the driver has been created and the test has reached
# the page state you want to preserve:
record = capture_timestamped_png(driver)
print(record)
This code assumes driver is an active Selenium WebDriver instance and that the test has already navigated to the desired state. Its timestamp is generated in the Python runtime immediately before calling save_screenshot. If you need to use the IDE-stored value instead, pass that ISO string into the function and sanitize it in the same way; the logged timestamp will then represent when the IDE command ran, which may precede the file capture slightly.
Use an IDE-provided timestamp
When your exported test runner exposes the Selenium IDE variable captureIso as a Python value called capture_iso, the filename and capture portion can be written as:
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →stamp = capture_iso.replace(":", "-")
output_path = Path("artifacts") / f"screenshot-{stamp}.png"
success = driver.save_screenshot(str(output_path))
if not success:
raise RuntimeError(f"Could not save {output_path}")
The exact variable plumbing depends on how the test is exported and invoked. Do not assume that a variable created in an IDE playback session automatically becomes a variable in a separately generated Python program; verify the export or bridge used by your runner.
Choose a capture approach
| Approach | Where capture happens | Control and portability | Best fit |
|---|---|---|---|
| Exported WebDriver capture | In a Selenium WebDriver binding or test runner | Direct control of path, timestamp format, output directory, and retention. Requires a code-export or runtime step. | Repeatable test evidence and CI artifacts |
| Plugin or custom command | Within an IDE-oriented flow, if the particular release and plugin support it | Behavior and availability depend on the specific Selenium IDE release and extension; no screenshot command is listed in the official catalog. | Teams that need an IDE-centered workflow and can validate the extension |
| Browser or manual capture | Outside the automated test’s controlled artifact step | Convenient for a one-off visual check, but not deterministic or portable enough for repeatable evidence. | Ad hoc debugging |
Make filenames and records useful
Use a safe, sortable name
An ISO timestamp includes colons and punctuation that may be inconvenient or invalid in filenames, depending on the operating system and tooling. Replacing : with - produces a readable token while preserving date ordering. Add a test or page label when several screenshots may be emitted in one run, and ensure that label is also sanitized if it comes from input.
Preserve the exact event time separately
A filename usually needs only enough precision to distinguish artifacts. For audits or correlation with logs, record the original ISO value unchanged, including its UTC marker and fractional seconds. Store it in structured test output or a sidecar JSON record alongside the browser, viewport, test name, and screenshot path. That makes it possible to distinguish the time recorded by the test from the filesystem’s later modification time.
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
Decide artifact location and retention
Use an explicit, known directory rather than relying on the process’s current working directory. In CI, confirm that the directory is included in the job’s artifact upload and retention rules. A successfully written local file can still be lost when a temporary runner exits if the artifact collection step is missing.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Validate the capture step
-
Generate the timestamp at the capture boundary, not at test startup, if it is intended to describe the screenshot event.
-
Sanitize filename-unsafe characters but retain the original ISO timestamp in logs or metadata.
-
Use an absolute or deliberately configured artifact directory and verify that the runtime can write there.
-
Check the return value from
save_screenshotand confirm the expected file exists; fail the test rather than silently passing without evidence.Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
-
Record browser, viewport, test name, timestamp, and path together when the artifact must be traceable later.
Troubleshooting timestamped screenshots
No screenshot command appears in Selenium IDE
This is consistent with the documented command catalog: it lists execute script and timing/control-flow commands, but not a built-in screenshot-to-file command. Keep authoring and sequencing in the IDE, then use a WebDriver runtime for the PNG. If relying on an extension or custom command, verify its compatibility with the Selenium IDE release and test whether it writes a file with the path and naming behavior you require.
The test records a timestamp but no PNG exists
A returned script value is only data; it does not capture or save an image. Add a WebDriver screenshot call at the capture boundary and check its result. Also confirm that the test is actually reaching that step and that the runner’s output directory is the one you are inspecting.
The filename is rejected or differs across operating systems
Remove or replace unsafe punctuation such as colons before using the timestamp as a filename component. Keep the unmodified timestamp in metadata so portability does not cost time precision or timezone information.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesThe file is missing in CI but appears locally
Resolve the artifact directory explicitly, check the runner’s write permissions, and configure the CI job to upload that directory. Local working directories and CI workspaces are not necessarily the same.
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
The file exists but the test passes after a failed capture
Do not treat the existence of an older file as proof that this run captured successfully. Check the current call’s boolean result and use unique timestamped names; raise an error when the call reports failure or the expected output was not created.
Or skip the browser setup
If your goal is simply to create a screenshot from a URL rather than capture the exact state of an in-progress Selenium test, ScreenshotNeo offers a one-request website screenshot API and an MCP server for AI agents. It is not a replacement for a WebDriver capture of a page state created by your test, but it can avoid setting up a browser runtime for URL-based shots.
Install the Python requests package, then run this example with your API key:
Free tools Windows power users keep installed
One-click scans. No signup required.
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
timeout=90,
)
open("shot.webp", "wb").write(r.content)
See the ScreenshotNeo documentation for request options and response details. Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots, and the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up free for ScreenshotNeo.
Frequently Asked Questions
Can Selenium IDE add the timestamp directly to a screenshot filename?
Not with a documented built-in screenshot command. Use an IDE-generated timestamp with a WebDriver capture step, or generate the timestamp in the WebDriver runtime immediately before saving.
Why preserve the timestamp separately if it is already in the filename?
The filename token may be sanitized for portability. Keep the original ISO value in logs or metadata when exact fractional seconds and UTC context matter.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

