Skip to content

Test agent setup for Windows X86 Android Appium

OliverShen edited this page Jun 8, 2023 · 6 revisions

Download the application.yml following the Guideline: Download the agent configuration.

Setup Hydra Lab Agent on Windows(X86/X64)

  1. Register an agent in Hydra Lab Center WebSite. (Please contact [email protected] if you are Microsoft FTE and want to use the MS internal network)

image

  1. Create a new folder in you PC.
  2. Download the latest agent.jar or build the agent project as agent.jar. Then, copy the file to the folder. To build the agent, run the following command in the project root dir:
gradlew :agent:bootJar
  1. Unzip HydraLab_Agent_Installer_Windows.zip to the folder, the folder shows like this picture.

image

  1. Download application.yml from portal (a sample configuration is available here: sample YAML config)

image

  • app.registry.server
    • The hostname + port of the center server. For instance, if it's running on a machine with the hostname of testagent.hydralab.com and servicing on port 9886, then this value should be "testagent.hydralab.com:9886".
  • app.registry.id
  • app.registry.secret
  • app.registry.name
  • app.device.monitor (Indicate the type of test devices for Testing)
    • windows.enabled: Default value is false.
    • android.enabled: Default value is true
    • ios.enabled: Default value is false.
  • management.metrics.export.prometheus.pushgateway.enabled (Optional; If true, will send metrics to our stability monitor. When an exception happens, we will receive emails.)

Start/Stop Hydra Lab Agent

1. Android or iOS agent

  1. Setup log file location: modify AgentService.xml and replace {LOG_FILE_LOCATION}

  2. Install it as a Windows Service: open cmd/powershell (admin), execute command : .\AgentService.exe install

image

  1. Open Windows Services and find a service named Hydra Lab Agent Service.

image

  1. You can start/stop the service.

image

  1. If it starts successfully, the agent will show up in HydraLab center portal. BTW, only the agent connected with devices will be displayed on the page.

image

2. Cross-platform agent (Windows + Android)

PS. The WinAppDriver can't work normally if started by Windows Service.Issue link

  1. Update restartAgent.bat: comment line18,31 and uncomment line 20,29.

image

  1. Start agent directly: open cmd/powershell (admin); cd to the install folder; execute restartAgent.bat script

If you want to keep your Windows test agent awake without locking itself over time, so as to run UI tests for Windows apps, consider leveraging the PowerToy toolset - awake feature | Awake Utility to keep the Windows device active.

Clone this wiki locally