How to Export Code from Selenium IDE
Export a Selenium IDE test or suite as WebDriver code, choose a target, and understand what to do with the generated file.
To export WebDriver code from Selenium IDE, open the project, right-click a test or suite in the test list, choose Export, select a language and framework offered by your installed version, then click Export. Selenium IDE downloads a generated source file to the browser’s download directory. If available, enable origin-tracing comments to annotate generated code with the IDE step that produced it. Selenium IDE Code Export documentation.
Export a test or suite
- Open the Selenium IDE project containing the test.
- In the test list, right-click the individual test you want, or the suite to export multiple tests.
- Choose Export from the context menu.
- Select a target language and framework from the menu shown by your installed IDE.
- If the option is available and useful for review, enable origin-tracing comments.
- Click Export. Find the generated file in the browser’s download directory.
The result is generated WebDriver source code. It is a starting point for inspection and adaptation, not a complete, automatically configured project. You may need to create a project, add compatible WebDriver and test-framework dependencies, configure a browser driver, and adjust generated steps to match your application and framework conventions.
Choose an export target
The Selenium IDE Code Export guide lists C# NUnit, Java JUnit, JavaScript Mocha, and Python pytest. The separate plugin-support page lists Java JUnit, JavaScript Mocha, Python pytest, and C# xUnit. These official pages conflict about C# framework support and are dated; target availability can vary by installed version. Treat the export menu in your IDE as the practical source of available targets, rather than assuming either documentation list is a definitive current compatibility matrix. Code Export guide · Code Export Plugin Support.
| Choose based on | What to check |
|---|---|
| Language fit | Use the language your team already maintains. |
| Test framework | Check whether the available target matches your runner, such as pytest, Mocha, JUnit, or NUnit. |
| Runtime compatibility | Confirm the generated code works with the runtime and Selenium/WebDriver versions used by your project. |
| Customization | If built-in output is insufficient, investigate a plugin or adapt the code to your framework. |
The guide includes historical project setup and dependency examples. Do not copy old pinned dependency versions as current recommendations; choose versions compatible with your runtime and Selenium setup.
What to do with the generated source
- Open the downloaded file and review the generated test structure and WebDriver calls.
- Place the code in a project using the selected language and test framework.
- Set up compatible Selenium/WebDriver dependencies and the browser execution environment for that project.
- Run the test and adapt selectors, waits, setup, teardown, and assertions to your application and team conventions.
- Keep the Selenium IDE project as the editable recording source if you expect to revise and export it again.
Generated code helps reveal how recorded IDE commands map to WebDriver calls. Expect to review it: a recording does not know your project’s preferred architecture, shared fixtures, or dependency management.
Exported code versus test results
These are separate operations. Code Export creates WebDriver source from IDE steps so you can develop or adapt a test. The command-line runner’s --output-directory and --output-format options save execution results in Jest/JSON or JUnit/XML formats. If you meant a report from a run, use the runner’s result-output workflow rather than Code Export. Selenium IDE Command-line Runner documentation.
Custom export languages
Selenium IDE plugins can augment an existing export language or add a new one. The plugin documentation describes declaring supported language IDs in a manifest or using a vendor entry for a new language, then responding to export events with generated content. This requires plugin development; it is not a setting that turns on a new target in the ordinary export dialog. The plugin reference is dated, so check compatibility with the IDE version in use. Code Export Plugin Support.
Or skip the browser setup
If your task is to capture a page screenshot while inspecting a test or debugging a visual issue, ScreenshotNeo provides a website screenshot API and MCP server. One GET request returns an image or PDF. Cookie banners, newsletter popups, and chat widgets are removed before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. See the ScreenshotNeo API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
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)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
Get 1,000 free screenshots a month with no card.
Troubleshooting
| Problem | Likely cause | What to do |
|---|---|---|
| Export is missing from the menu | You may have right-clicked outside a test or suite, or the selected item/version may not expose the action. | Right-click the test or suite in the project’s test list. Check the installed IDE version and its available menu actions. |
| Your expected language or framework is not listed | Targets vary, and the official documentation pages disagree about C# framework support. | Use the targets shown by your installed export menu. For another target, investigate plugin development or adapt generated code. |
| You cannot find the exported file | The browser saves it in its configured download directory, which may differ from the project folder. | Check browser downloads and the configured download location. Export again if needed. |
| The file does not run as a project | Code Export produces source, not a complete project with dependencies and browser setup. | Create the project and add compatible runtime, Selenium/WebDriver, and test-framework dependencies, then configure browser execution. |
| Generated code uses unfamiliar or outdated setup | The documentation’s setup examples are historical. | Keep the generated test logic you need, then use current versions compatible with your environment rather than copying old pinned examples. |
| You wanted a test report, not source | Code export and runner result output are different workflows. | Run the command-line runner with its output-directory and output-format options for Jest/JSON or JUnit/XML results. |
Performance, reliability, and maintenance
Exporting creates a local source file; it does not run the test or guarantee that the generated code will pass in another environment. Reliability depends on the resulting project’s dependencies, browser setup, selectors, application state, and wait strategy. Keep framework and Selenium versions compatible, review generated waits and selectors, and run the test in the same environment used by your team. The cited documentation provides no current benchmark or cost figure for code export, so none is assumed here.
FAQ
Can I export a whole suite?
Yes. Right-click the suite and use Export, then choose an available target.
Does origin tracing change what the test does?
It adds comments connecting generated code to IDE steps, which can help trace or review the output.
Can I export Selenium IDE run results as code?
No. Code Export generates WebDriver source; runner output options save results in report formats.
Can a plugin add my team’s language?
The plugin documentation describes adding or extending export languages, but this requires plugin development and version-compatible integration.


