Importing and Exporting Tests in Selenium Format

Move Selenium tests into the Ghost Inspector service, and back out again

Search our documentation:

Toggle Documentation Menu

Importing and Exporting Tests in Selenium Format

Selenium is a popular, open source browser automation tool set. Ghost Inspector allows for both the import and export of tests in Selenium HTML format. This format is used by both Selenium IDE and Selenium Builder extensions.

Jump to...
  • Importing - Import a test in Selenium 1 format (HTML)
  • Exporting - Export a test or suite in various Selenium formats

Importing Selenium Tests

Ghost Inspector allows you to import single tests in Selenium HTML format. This is done from the suite screen (so you must have or create a suite first). Under the "Actions" menu, choose the "Import a Test in Selenium Format (.html)" option. This will present you with a file selection box for choosing the local .html file on your machine.

Selenium Import

The import process should take no more than a few seconds. Once complete, you'll be redirected to the test editor screen showing the steps of your imported test. Here you can review the imported steps and make any necessary adjustments. Use the "Save" button to save the test after review. You will be returned to the test's main screen where you can then run the test.

Note: Ghost Inspector may remove or convert unnecessary steps. For instance, commands like waitForPageToLoad and waitForElementPresent are not necessary with Ghost Inspector, because these are applied automatically between each step.

Ghost Inspector supports both CSS and XPath selector methods. The following selector values are supported.

css=
xpath=
id=
name=
type=
link=

Ghost Inspector supports the vast majority of commonly used commands available in the Selenium HTML format. Below is a complete list of supported commands. (Note that the *AndWait versions of all these commands are also supported.)

captureEntirePageScreenshot
click
contextMenu
doubleClick
dragAndDropToObject
keyPress
mouseDown
open
openWindow
pause
refresh
runScript
select
sendKeys
store
storeEval
type
assertElementNotPresent
assertElementPresent
assertEval
assertLocation
assertNotLocation
assertNotText
assertNotTitle
assertText
assertTextNotPresent
assertTextPresent
assertTitle
verifyElementNotPresent
verifyElementPresent
verifyEval
verifyLocation
verifyNotLocation
verifyNotText
verifyNotTitle
verifyText
verifyTextNotPresent
verifyTextPresent
verifyTitle
Note: While Ghost Inspector currently only imports Selenium HTML format files, the Selenium Builder extension for Firefox has the ability to open various other formats and convert them to the HTML format that Ghost Inspector accepts.


Exporting Selenium Tests

Ghost Inspector has the ability to export Selenium files in the same Selenium 1 (HTML) format that it imports, as well as Selenium 2 (JSON) format. You can export a single test as a .html or .json file, or an entire suite of tests in a .zip archive. This can be done through both our API and our application.

If you wish to export a test in Selenium format in our application, you can do so via the “Download in Selenium Format” link in the test’s “Action” menu. (The same can be done for a suite in the suite’s “Action” menu.)

Selenium export menu
Note: While Ghost Inspector currently only exports Selenium's HTML and JSON formats, the Selenium Builder extension for Firefox has the ability to open those files and convert them to various other formats and languages. The video below outlines that process.

Selenium Export and Conversion using Selenium Builder