TestProject Forum
Powered by leading experts in the test automation community

ComposeFile properties

Somebody know what should i write in it or not ?
I know the default template but i need a little bit more information about it. And i also red the https://hub.docker.com/r/testproject/agent article.

Thanks!

Hello @pasztor.mate
You can take the template as is, only change the TP_JOB_ID to the ID of the job you want to execute and TP_API_KEY to your API key.

1 Like

I have another simple question :slight_smile: What can i do whit the compose file to create more instance, couse if I run docker-compose 2 times(i change the names) it doesnt create 2 two container it writes up the first one. I want to create more agent, from the same docker. But if it is a docker issue sorry for being dummy, I have started with dockers just a week ago.

You can just change the name of the container and run

docker-compose -f file.yml up

again, it will create another container with another agent.

Recreating happens it doesn’t create a new one.
@ran.tzur

Docker Compose --scale flagstrong text is the
problem solver

but after a fue minutes the container stops themself so its still an exsisting
problem

Hello, the containers will stop after job execution is done.
To change that, you need to delete the TP_JOB_ID variable.

I used this compose so… I have done this step:
version: “3.1”
services:
testproject-agent:
image: testproject/agent:latest
container_name: testproject-agent
depends_on:
- chrome
- firefox
volumes:
- /********:/var/testproject/agent
environment:
TP_API_KEY: “**********************”
CHROME: “chrome:4444”
FIREFOX: “firefox:4444”
chrome:
image: selenium/standalone-chrome
volumes:
- /dev/shm:/dev/shm
firefox:
image: selenium/standalone-firefox
volumes:
- /dev/shm:/dev/shm

And the container stopped after the execution?

In same time only one container runs from my docker doesn’t matter what i do with the containers.

Did you change the container name?

Yes I changed it. And if I register manually my agents with
docker run --name agent3 -p 8585:8585 testproject/agent:latest
(In this case I get more than one but without Browser, when I want to attach browsers with compose it stops all the runing containers.

I’m also want to ask the same thing…how can I fire away 2 agents and use the selenium browser…I can’t seem to make it work

Hello @jchan
What do you mean by same selenium browser?

what I meant was the chrome and firefox selenium standalone browsers…
I found it in another thread that I can dock multiple agents by changing TP alias

That us correct.
You can add multiple agents in one yaml file, just need a different alias and different container names.

Dear ran.tzur !

If I use scale on the testproject service and I create 2 same container, they can’t run together. Every time when i start one of them, the another one stop them self. It is a common issue or it’s a docker file problem from myside ?

The logs says its a sessionidMismatch.

Can you share your yaml file please.

version: “3.1”
services:
testproject-agent1:
image: testproject/agent:latest
depends_on:
- chrome
- firefox
volumes:
- /some/thing/testproject:/var/testproject/agent
environment:
TP_API_KEY: “”
CHROME: “chrome:4444”
FIREFOX: “firefox:4444”
chrome:
image: selenium/standalone-chrome
volumes:
- /dev/shm:/dev/shm
firefox:
image: selenium/standalone-firefox
volumes:
- /dev/shm:/dev/shm