Importing and Exporting Test Data

Ghost inspector provides a few different import and export options when it comes to your test data:

Table of Contents

  • Importing Ghost Inspector JSON Tests

  • Importing Selenium HTML Tests

  • Exporting Tests and Suites

Importing Ghost Inspector JSON Tests

Ghost Inspector allows you to import tests in JSON (JavaScript Standard Object Notation) format while preserving your test settings and step details as well as imported steps. Note that imported tests must already exist in the system and must be referenced by _id. The Ghost Inspector JSON import feature accepts the Ghost Inspector test export format.

To import at test, navigate to your suite within the application and select More > Import a Test in Ghost Inspector Format (.json):

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.

Ghost Inspector format JSON tests can also be imported via the API.

Importing Selenium HTML Tests

Ghost Inspector also allows you to import single tests in Selenium IDE's HTML format. This is done from the suite screen (so you must have or create a suite first). Under the More 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

This import process will also take you to the test editor where you can make adjustments to the test before saving.

Selenium v1 Command Compatibility

Note: Using the Selenium v1 HTML format, Ghost Inspector may remove or convert unnecessary steps. For instance, commands like waitForPageToLoad andwaitForElementPresent 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

Selenium HTML format tests can also be imported via our API.

Exporting Tests and Suites

Ghost Inspector has the ability to export tests into several formats. Here is a breakdown of the different options and their features:

NameFormatFeatures
Ghost Inspector Format.json
Selenium IDE v3.side
  • Executable withthe Selenium IDE v3 browser extension
  • Not currently importable into Ghost Inspector
Selenium IDE v1.html

To download a suite or a test navigate to the suite or test in our system and click on More > Export this Suite/Test. You will be prompted with a dialog that will allow you to select the format to download the test(s) in. Note that if you are downloading a suite you will be provided with a .zip file containing the tests. If you are downloading a single file, you will receive the file in the specified format.

Select a test format to export from the export tests dialog