Skip to main content
No Result Found

Export tests

Allows you to export tests from Low Code Automation as code in .side format.

Get test scripts by ID

Fetches the test details based on the specified test ID and format.

GET /api/v1/tests/{test_id}/export

Request parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" -X GET "https://lcnc-api.browserstack.com/api/v1/tests/{test_id}/export"
  • test_id* String

    Unique identifier of the test. Replace test_id in the request path with your test ID.

Response attributes 200 application/json

Response

{
    "id": "example-project",
    "version": "2.0",
    "name": "Example Project",
    "url": "https://www.browserstack.com",
    "tests": [
        {
            "id": "bebf705c719ec37af1b35e7e9102b68927823781",
            "name": "Sample login test",
            "description": "",
            "tags": [],
            "commands": [
                {
                    "id": "de45d6cf-ac65-422b-9f5c-fa58d25ee036",
                    "comment": "Step 1: Open page <strong>\"BrowserStack Login\"</strong>",
                    "command": "open",
                    "targets": [],
                    "target": "https://www.browserstack.com",
                    "value": ""
                },
                {
                    "id": "1a7ee0b3-d98a-4092-8668-12ee50696b7d",
                    "comment": "Set Resolution",
                    "command": "setWindowSize",
                    "targets": [],
                    "target": "1440x875",
                    "value": ""
                },
                {
                    "id": "83b2f3e4-aaf6-4d6c-bf05-009a38ac7e52",
                    "comment": "#ToDo: Setup browser locale",
                    "command": "echo",
                    "targets": [],
                    "target": "This step type is currently not supported",
                    "value": ""
                },
                {
                    "id": "3dd21323-909b-441c-a3b0-9139226984fc",
                    "comment": "Step 2: Click on <strong>\"Accept all\"</strong> button",
                    "command": "click",
                    "targets": [],
                    "target": "xpath=//HTML/BODY[1]/DIV[5]/DIV[2]/DIV[1]/DIV[1]/DIV[2]/DIV[1]/DIV[1]/BUTTON[2]",
                    "value": ""
                },
                {
                    "id": "32b41b22-1be7-491d-9385-5a459feb87bc",
                    "comment": "Step 3: Click on <strong>\"Enter your email\"</strong> email input",
                    "command": "click",
                    "targets": [],
                    "target": "xpath=//HTML/BODY[1]/DIV[1]/SECTION[1]/DIV[1]/DIV[1]/DIV[1]/DIV[1]/DIV[1]/DIV[1]/FORM[1]/DIV[1]/INPUT[1]",
                    "value": ""
                },
                {
                    "id": "5672d944-8f49-41fe-80d7-bcabbdd56414",
                    "comment": "Step 4: Type <strong>\"random@example.com\"</strong> in <strong>\"Enter your email\"</strong> email input",
                    "command": "type",
                    "targets": [],
                    "target": "xpath=//HTML/BODY[1]/DIV[1]/SECTION[1]/DIV[1]/DIV[1]/DIV[1]/DIV[1]/DIV[1]/DIV[1]/FORM[1]/DIV[1]/INPUT[1]",
                    "value": "rajesh.p.chilka@gmail.com"
                },
                {
                    "id": "3f6fcf5c-b572-4c05-af0d-4b3bf98245c1",
                    "comment": "Step 5: Click on <strong>\"Log in\"</strong> element",
                    "command": "click",
                    "targets": [],
                    "target": "xpath=//HTML/BODY[1]/DIV[1]/SECTION[1]/DIV[1]/DIV[1]/DIV[1]/DIV[1]/DIV[1]/DIV[1]/FORM[1]/DIV[2]/BUTTON[1]/SPAN[1]",
                    "value": ""
                },
                {
                    "id": "4c4f99ae-7eae-4bee-bd0a-de4b452b1adc",
                    "comment": "Step 6: Type <strong>\"Test@1234\"</strong> in <strong>\"password\"</strong> input",
                    "command": "type",
                    "targets": [],
                    "target": "xpath=//HTML/BODY[1]/DIV[1]/DIV[1]/DIV[1]/FORM[1]/DIV[1]/DIV[1]/DIV[2]/INPUT[1]",
                    "value": "P@55w0rd@1234"
                },
                {
                    "id": "8c272013-ce52-4730-8de9-b3484f74047e",
                    "comment": "Step 7: Click on <strong>\"Continue\"</strong> element",
                    "command": "click",
                    "targets": [],
                    "target": "xpath=//HTML/BODY[1]/DIV[1]/DIV[1]/DIV[1]/FORM[1]/DIV[2]/BUTTON[1]/DIV[1]",
                    "value": ""
                },
                {
                    "id": "6300a136-ad7d-4a96-a2aa-6f3ba232c23f",
                    "comment": "Step 8: Validate element text is <strong>\"Logged in successfully\"</strong>",
                    "command": "assert",
                    "targets": [],
                    "target": "localAssertionResult_95070",
                    "value": "true"
                }
            ]
        }
    ],
    "suites": [
        {
            "id": "suite-id-1",
            "name": "Default Suite",
            "persistSession": false,
            "parallel": false,
            "timeout": 300,
            "tests": [
                "bebf705c719ec37af1b35e7e9102b68927823781"
            ]
        }
    ],
    "urls": [
        "https://www.browserstack.com"
    ],
    "plugins": []
}

Get all recorded tests

Fetches the list of tests associated with your user group.

GET /api/v1/test-list

Request

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" -X GET "https://lcnc-api.browserstack.com/api/v1/test-list"

Response attributes 200 application/json

Response

[
  {
    "test_id": "315d0cfdf7d77a422434f87c0d6764cc8d3fj38j",
    "name": "Sample Test 02 | Apple add to cart",
    "tags": [
      "sample",
      "smoke"
    ]
  },
  {
    "test_id": "315d0cfdf7d77a42243ff87c0d6764cc8d3fj347",
    "name": "Sample Test 01 | Amazon add to cart",
    "tags": [
      "sample",
      "smoke"
    ]
  },
  {
    "test_id": "728d0cfdf7d77a42243ff87c0d6764cc8d3fj38j",
    "name": "Sample Test 03 | Bstackdemo add to cart",
    "tags": [
      "sample",
      "smoke"
    ]
  }
]
  • test_id String

    Unique identifier of the test.

  • name String

    Name of the test.

  • tags Array

    List of tags associated with the test.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Download Copy Check Circle