OXYGEN
HomeGitHubReleasesCommunity
  • Welcome to Oxygen
  • About
    • What is Oxygen?
    • Getting Started (Videos)
      • Oxygen IDE Controls Overview
      • Recording a Web Test
      • Oxygen Commands Explained
    • Getting help
  • Download and work with Oxygen
    • Download & Installation
      • Oxygen IDE Installation
      • Oxygen for Mobile Installation
      • Oxygen for Windows Desktop Automation Setup
      • Oxygen for Mac Installation
        • Mac Installation Troubleshooting
      • Oxygen CLI Installation
      • Java Installation Instructions
      • Recording Troubleshooting
    • Start working with Oxygen
      • Getting Started - Web
        • Introduction - Web Testing
        • Recording a Web Test
        • Creating a Web Test
        • Sample Project - Web Test
      • Getting Started - Mobile
        • Introduction - Mobile Testing
        • Recording a Test on Mobile
        • Creating a Test - Mobile
        • Sample Project - Mobile
      • Getting Started - Oxygen for Windows Desktop Automation
      • Getting Started- Oxyge CLI
        • Running a Test Script on Windows
        • Running Multiple Tests (Suites) on Windows
    • Oxygen Modules
      • assert
      • date
      • db
      • email
      • eyes
      • http
      • log
      • mailinator
      • mob
      • pdf
      • proxy
      • serial
      • shell
      • soap
      • twilio
      • utils
      • web
      • win
    • Test Parameters
  • Cloud Providers
    • Sauce Labs
    • Lambda Test
    • TestObject
  • Advanced programming in Oxygen
    • Project Configuration
    • Locating Elements
    • Page Objects
    • Environments
    • Code Components
Powered by GitBook
On this page

Was this helpful?

  1. Advanced programming in Oxygen

Environments

Similarly to page objects, environments can be set up to properly organize your desired environments. They may include different URLs and different users for each environment. They will be stored in a special file called oxygen.env.js

setting up our environments:

module.exports = {

    TEST: {
        url: 'https://test.app.com',
        con_string: 'Driver={SQL Server};Server=DESKTOP\\SQLEXPRESS;Database=test;',
        username: 'testuser',
        password: 'test123'
    },

    PREP: {
        url: 'https://prep.app.com',
        con_string: 'Driver={SQL Server};Server=DESKTOP\\SQLEXPRESS;Database=prep;',
        username: 'prepuser',
        password: 'prep123'
    }
    
}

now that we've set them up, we can choose them by clicking on the settings icon on the top right

let's choose the PREP environment and use it in our script:

web.init()
web.open(env.url) // https://prep.app.com

db.setConnectionString(env.con_string) 

web.type('id=username', env.username)
web.type('id=password', env.password)

PreviousPage ObjectsNextCode Components

Last updated 4 years ago

Was this helpful?