Skip to main content
Experience faster, smarter testing with BrowserStack AI Agents. See what your workflow’s been missing. Explore now!
No Result Found
Connect & Get help from fellow developers on our Discord community. Ask the CommunityAsk the Community

Bulk export tests as code

Learn how to download and convert tests into code in multiple languages using a shell script in Low Code Automation.

Use this guide to export your Low Code Automation tests to code in different programming languages using a shell script.

Prerequisites

  • BrowserStack Username and Access Key from your My Profile page.
  • Node.js and npm must be installed.
  • The jq command-line JSON processor must be installed on macOS or Linux. On Windows, use Windows Subsystem for Linux (WSL) or Git Bash for compatibility.

Supported languages

  • Python (Pytest)
  • Java (JUnit)
  • JavaScript (Mocha)
  • C# (NUnit)
  • C# (XUnit)
  • Ruby (RSpec)

Shell script

Save the following shell script as side-to-code-converter.sh:

Shell Script
Copy icon Copy

Steps to run

  1. Save the above script as side-to-code-converter.sh.
  2. Open the terminal or Git Bash and navigate to the file’s location.
  3. Set the environment variables:
     export ACCESS_TOKEN="username:access-key"
     export LANGUAGE="Python_Pytest"
    
  4. Run the following script:
     bash side-to-code-converter.sh
    

Use Git Bash or Windows Subsystem for Linux (WSL) on Windows for compatibility. Native Windows Command Prompt is not supported.

Output

The following output files are generated

  • Downloaded .side files will be saved in the downloaded_side_files folder.
  • Converted code files will be saved in converted_code_files, named as:
    <testName>_<first5charsOfTestId>.<extension>

Troubleshooting

Use the following checks if you encounter issues during execution:

  • Ensure your ACCESS_TOKEN is correct.
  • Make sure jq is installed:
    • macOS: brew install jq
    • Ubuntu: sudo apt install jq
    • Windows: Use Git Bash or Windows Subsystem for Linux (WSL).

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

Is this page helping you?

Yes
No

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!

Talk to an Expert
Download Copy Check Circle