th2-hand is used to interpret and transmit commands from th2-act to Selenium or Windows Application Driver and vice versa. All incoming and outgoing data is stored in Cradle as messages.
- JDK 8+ (OpenJDK 11 is recommended)
- Gradle (Optional)
- Docker
This project is built by Gradle. You cat use Gradle wrapper to build it:
./gradlew build
To build a Docker image use Dockerfile, e.g.
docker build -t <image name>:<version> -f Dockerfile .
This project uses the Schema API to get its settings.
For local run it needs custom.json
, grpc.json
, rabbitMQ.json
and mq.json
files.
The custom.json
file contains RemoteHand URLs map and has the following format:
- session-alias / sessionAlias == "th2-hand" by default - hand publishes messages related to UI command under this session alias
- screenshot-session-alias / screenshotSessionAlias = "th2-hand-screenshot" by default - hand publishes messages with a screenshot under this session alias
- session-group / sessionGroup = "th2-hand-group" by default - hand publishes all messages under this session group.
- message-batch-limit / messageBatchLimit = 1048576 by default - limit size for batching messages.
- drivers-mapping / driversMapping - UI drivers settings.
- rh-options / rhOptions - remote hand options settings.
- response-timeout-sec / responseTimeoutSec = 120 by default - timeout for waiting result form remote hand.
- use-transport / useTransport = true by default - if true, hand used th2 transport protocol to publish messages via MQ.
{
"session-alias": "aliasName",
"driversMapping": {
"first" : {
"type" : "web",
"url" : "http://localhost:4444"
},
"second" : {
"type" : "windows",
"url" : "http://localhost:4445"
}
},
"rhOptions": {
"Browser" : "Chrome"
}
}
th2-hand gRPC server port to run is configured in grpc.json
:
{
"server":{
"port" : 8080
}
}
The mq.json
file must have two configured queues.
The first queue configured in Message storage is for raw messages. It must have "publish" and "raw" mandatory attributes.
The second queue configured in Message storage is for parsed messages. It must have "publish" and "parsed" mandatory attributes.
Example of mq.json
:
{
"queues": {
"send_raw" : {
"name": "default_general_decode_in",
"queue": "send_raw_queue",
"exchange": "default_general_exchange",
"attributes": ["raw", "publish"]
}
}
}
The rabbitMQ.json
file must contain settings to connect to RabbitMQ.
Example of rabbitMQ.json
:
{
"host": "mq_host",
"vHost": "mq_vhost",
"port": 32600,
"username": "mq_username",
"password": "mq_pass"
}
- Added th2 transport support
- bom:
4.6.1
- common:
5.10.0-dev
- grpc-hand:
3.0.0-dev
- common-utils:
2.2.3-dev
- org.owasp.dependencycheck:
9.0.9
- com.gorylenko.gradle-git-properties:
2.4.1
- com.github.jk1.dependency-license-report:
2.5
- de.undercouch.download:
5.6.0
- Migrated to Books & Pages concept
- added 'SelectFrame' web action
- fixed SwitchActiveWindow action
- reads dictionaries from the /var/th2/context/dictionary folder
- uses mq_router, grpc_router, cradle_manager optional JSON configs from the /var/th2/context folder
- tries to load log4j.properties files from sources in order: '/var/th2/context', '/home/etc', configured path via cmd, default configuration
- update Cradle version. Introduce async API for storing events
- removed gRPC event loop handling
- fixed dictionary reading