At startup, the OpenTest server looks into its working directory for a configuration file named
server.yaml. This working directory is also the location where all the dynamically-generated data will be stored (database, log data, screenshot files, etc.).
Similarly, the test actor looks into its working directory for a configuration file named
actor.yaml and saves all the data it generates into that same directory.
You can create multiple working directories for the OpenTest server and for the test actor(s) and switch between them as necessary to prepare for executing various test automation scenarios.
The server configuration file must be located in the root of the server’s working directory and is named
server.yaml. You’ll typically want to create a directory structure similar to the one shown below, containing the server’s working directory, the test actor’s working directory and the test repository directory:
C:\opentest ├── server │ └── server.yaml ├── actor1 │ └── actor.yaml └── test-repo └── ...
# Number of seconds a test session will wait to acquire the necessary # test actors before it is cancelled acquireActorsTimeoutSec: 1200 # Number of seconds a test session will be cancelled after, when there is # no activity (no actors are making any progress executing test segments) noActivityTimeoutSec: 3600 # The port the server listens on serverPort: 3000 # The path to the root of the test repository directory. If you're using # backslash characters in double quotes, you'll need to escape them # (e.g. "C:\\opentest\\test-repo") testRepoDir: C:/opentest/test-repo
When switching often between multiple test automation projects, a best practice is to have multiple server working directories, each one of them having its
server.yaml file to point to the test repo for one of the projects. For example:
C:\opentest ├── server-proj1 │ └── server.yaml ├── server-proj2 │ └── server.yaml └── test-repo-proj1 │ └── ... └── test-repo-proj2 └── ...
server.yaml file for the first project would look something like that:
When you intend to start working on a particular project, start the OpenTest server in the directory that corresponds to the project you want to work on, by specifying the working directory at the command line:
opentest server C:\opentest\server-proj1
Test actor configuration
The parameters from the snippet below must be present in every
actor.yaml file. The most important (and mandatory) parameters are
Please note that the Selenium-related parameters are all placed under the
selenium: # The URL of the Selenium server. If this parameter is not specified, a # local Selenium driver will be instantiated, as specified in the desired # capabilities section seleniumServerUrl: http://127.0.0.1:9515 desiredCapabilities: browserName: chrome chromeOptions: args: [ --start-maximized ] chromeDriverExePath: C:/Selenium/chromedriver.exe edgeDriverExePath: firefoxDriverExePath: C:/Selenium/geckodriver.exe ieDriverExePath: operaDriverExePath: C:/Selenium/operadriver.exe safariDriverExePath: systemProperties: # property1: value1 maximizeWindow: true scriptTimeout: 20 # Instructs the test actor to reuse the same browser window every time a # test is run. This can be very beneficial during test development, but is # likely not wise to keep enabled in production. reuseDriver: false
Please note that the Appium-related parameters are all placed under the
appium: appiumServerUrl: http://127.0.0.1:4723/wd/hub # For more information see the Appium project's documentation at # http://appium.io/docs/en/writing-running-appium/caps/ desiredCapabilities: app: /Users/username/application.app automationName: XCUITest deviceName: iPhone Simulator platformName: iOS # The amount of time the test actor should wait when searching for UI # elements before throwing an exception explicitWaitSec: 10 # Instructs the test actor to reuse the same app instance every time a # test is run. This can be very beneficial during test development, but is # likely not wise to keep enabled in production. reuseDriver: false
API testing parameters
Please note that the API testing parameters are all placed under the
api: # Allows the HTTP client to ignore the web server certificate. Useful for # working with servers that are using self-signed certificates. ignoreCert: false # The HTTP proxy server to use when doing API testing using the the HttpRequest # action. This is useful when behind a firewall, or for capturing the outbound # HTTP requests with tools like Fiddler or Charles. httpProxy: localhost:8888
When working with multiple test actors (e.g. WEB, MOB, API), you should create multiple test actor working directories, each one of them containing the
actor.yaml file for a particular test actor. You should also put the test actor type in the name of the directory for easy identification. For example::
C:\opentest ├── actor-web │ └── actor.yaml ├── actor-mob │ └── actor.yaml └── actor-api └── actor.yaml
You can then start the test actor you want by specifying its working directory at the command line:
opentest actor C:\opentest\actor-web