PractiTest Discussion Forum

Using xbot for automation tests

Hello,

I have configured the xbot agent following the indications on the webpage PractiTest's xBot For Automation - PractiTest

A .config file has been generated and contains my personal API token, my client type and the backend url.

But when I run the xbot agent, I get this results : we see desconnexions and reconnexions , is it normal ?

2022/04/11 08:57:44 backend.go:40: Connecting to [wss://eu1-xbot-backend-prod.practitest.app/ws/xbot?agent-id=&api-token=&client-id=&enabled=true&os=windows&platform=Microsoft+Windows+10+Pro&platform-version=10.0.19044+Build+19044&source=xBot-go&version=2.0.5.beta&xbot-id=]
2022/04/11 08:57:44 backend.go:41: Agent version: 2.0.5.beta
2022/04/11 08:57:45 agent.go:111: Connected to backend successfully
2022/04/11 08:57:45 agent.go:136: read: websocket: close 1000 (normal): no soup for you
2022/04/11 08:57:46 agent.go:136: read: websocket: close 1000 (normal): no soup for you
2022/04/11 08:57:47 agent.go:136: read: websocket: close 1000 (normal): no soup for you
2022/04/11 08:57:48 agent.go:136: read: websocket: close 1000 (normal): no soup for you
2022/04/11 08:57:48 backend.go:118: Attempt to reconnect
2022/04/11 08:57:49 agent.go:136: read: websocket: close 1000 (normal): no soup for you
2022/04/11 08:57:49 backend.go:40: Connecting to [wss://eu1-xbot-backend-prod.practitest.app/ws/xbot?agent-id=&api-token=&client-id=&enabled=true&os=windows&platform=Microsoft+Windows+10+Pro&platform-version=10.0.19044+Build+19044&source=xBot-go&version=2.0.5.beta&xbot-id=]
2022/04/11 08:57:49 backend.go:41: Agent version: 2.0.5.beta
2022/04/11 08:57:49 backend.go:79: Reconnected to backend successfully
2022/04/11 08:57:50 agent.go:136: read: websocket: close 1000 (normal): no soup for you
2022/04/11 08:57:50 backend.go:118: Attempt to reconnect
2022/04/11 08:57:51 agent.go:136: read: websocket: close 1000 (normal): no soup for you
2022/04/11 08:57:51 backend.go:40: Connecting to [wss://eu1-xbot-backend-prod.practitest.app/ws/xbot?agent-id=&api-token=&client-id=&enabled=true&os=windows&platform=Microsoft+Windows+10+Pro&platform-version=10.0.19044+Build+19044&source=xBot-go&version=2.0.5.beta&xbot-id=]
2022/04/11 08:57:51 backend.go:41: Agent version: 2.0.5.beta
2022/04/11 08:57:51 backend.go:79: Reconnected to backend successfully
2022/04/11 08:57:52 agent.go:136: read: websocket: close 1000 (normal): no soup for you
2022/04/11 08:57:52 backend.go:118: Attempt to reconnect
2022/04/11 08:57:53 agent.go:136: read: websocket: close 1000 (normal): no soup for you
2022/04/11 08:57:53 backend.go:40: Connecting to [wss://eu1-xbot-backend-prod.practitest.app/ws/xbot?agent-id=&api-token=&client-id=&enabled=true&os=windows&platform=Microsoft+Windows+10+Pro&platform-version=10.0.19044+Build+19044&source=xBot-go&version=2.0.5.beta&xbot-id=]
2022/04/11 08:57:53 backend.go:41: Agent version: 2.0.5.beta
2022/04/11 08:57:54 backend.go:79: Reconnected to backend successfully
2022/04/11 08:57:54 agent.go:136: read: websocket: close 1000 (normal): no soup for you
2022/04/11 08:57:55 backend.go:118: Attempt to reconnect
2022/04/11 08:57:55 agent.go:136: read: websocket: close 1000 (normal): no soup for you
2022/04/11 08:57:56 backend.go:40: Connecting to [wss://eu1-xbot-backend-prod.practitest.app/ws/xbot?agent-id=&api-token=&client-id=&enabled=true&os=windows&platform=Microsoft+Windows+10+Pro&platform-version=10.0.19044+Build+19044&source=xBot-go&version=2.0.5.beta&xbot-id=]

When I try to run the test from practitest, it never launches and stay pending all the time : I have filled the automation configuration in the xbot test, my client type is recognized because I can see the graphics but nothing happen.

Could you tell me how should I resolve the problem please ?

Thank you in advance.

Sincerely yours.

Nope, it looks bad, looks like some configuration issue.
I see it’s trying to connect to EU backend URL, are you sure your account is on EU servers in Practitest? if not then you should use the US backend URL

Thank you for your indications but unfortunately if I try with the US backend URL, I have the same problem :

2022/04/11 14:10:48 backend.go:40: Connecting to [wss://xbot-backend-prod.practitest.com/ws/xbot?agent-id=&api-token=&client-id=&enabled=true&os=windows&platform=Microsoft+Windows+10+Pro&platform-version=10.0.19044+Build+19044&source=xBot-go&version=2.0.5.beta&xbot-id=]
2022/04/11 14:10:48 backend.go:41: Agent version: 2.0.5.beta
2022/04/11 14:10:49 agent.go:111: Connected to backend successfully
2022/04/11 14:10:49 agent.go:136: read: websocket: close 1000 (normal): no soup for you
2022/04/11 14:10:50 agent.go:136: read: websocket: close 1000 (normal): no soup for you
2022/04/11 14:10:51 agent.go:136: read: websocket: close 1000 (normal): no soup for you
2022/04/11 14:10:52 agent.go:136: read: websocket: close 1000 (normal): no soup for you
2022/04/11 14:10:52 backend.go:118: Attempt to reconnect
2022/04/11 14:10:53 agent.go:136: read: websocket: close 1000 (normal): no soup for you
2022/04/11 14:10:53 backend.go:40: Connecting to [wss://xbot-backend-prod.practitest.com/ws/xbot?agent-id=&api-token=&client-id=&enabled=true&os=windows&platform=Microsoft+Windows+10+Pro&platform-version=10.0.19044+Build+19044&source=xBot-go&version=2.0.5.beta&xbot-id=]
2022/04/11 14:10:53 backend.go:41: Agent version: 2.0.5.beta
2022/04/11 14:10:53 backend.go:79: Reconnected to backend successfully
2022/04/11 14:10:54 agent.go:136: read: websocket: close 1000 (normal): no soup for you
2022/04/11 14:10:55 backend.go:118: Attempt to reconnect
2022/04/11 14:10:55 agent.go:136: read: websocket: close 1000 (normal): no soup for you
2022/04/11 14:10:56 backend.go:40: Connecting to [wss://xbot-backend-prod.practitest.com/ws/xbot?agent-id=&api-token=&client-id=&enabled=true&os=windows&platform=Microsoft+Windows+10+Pro&platform-version=10.0.19044+Build+19044&source=xBot-go&version=2.0.5.beta&xbot-id=]

The additional question I have is I don’t see any agent in account setting in xbot (beta) : is it normal and what should I do for solving this problem ?

Thank you in advance.

Sincerely yours.

Not sure then…it’s still something about config, and this is why you don’t see the agent. Maybe it’s about the token itself? it should be from account settings and not private.
If I doesn’t help I’d contact support, they usually resolve issues like that quickly

Hello Phlip,

Thank you very much for your indications. We have tried with a general token and it works well now.

But we have an other problem : in my test I have written the following configuration :

Script Path (*)
C:\Users\TM\SeleniumTest\Testselenium.py

Client Type
THOMAS_M

Results Path
C:\Users\TM\SeleniumTest\results\

When I run the test I obtain this error message :

Agent ID:
The automated test ran at: 12-Apr-2022 15:13

Execution output:
exec: “C:UsersThomasMoriaudSeleniumTestTestselenium.py”: file does not exist

Each “\” has disappeared in the error message so the test can’t considerate correctly the path ignoring this symbol.

I realized that by dobling the symbol the Path can be recognized :

Script Path (*)
C:\\Users\\TM\\SeleniumTest\\Testselenium.py

Client Type
THOMAS_M

Results Path
C:\\Users\\TM\\SeleniumTest\\results\\

But unfortunately in this case I get an other error message :

Agent ID:
The automated test ran at: 12-Apr-2022 15:53

Execution output:

fork/exec C:\Users\ThomasMoriaud\SeleniumTest\Testselenium.py: %1 is not a valid Win32 application.

Do you know how to resolve this problem ?

Thank you very much in advance.

Sincelery yours.

Hi Thomas,
Following our correspondence on Support channel:
xBot can execute only files that are executable by their configuration, such as .bat, .exe or .sh in Mac cases.
In a case like yours you needed to convert .py file into an executable one by using pyinstaller and that resolved the issue.

We’re considering different options to enhance xBot so it will execute more files on its own. Once we have something specific on our roadmap, we will update this topic as well.

Best regards,
Alex Gruzglin, PractiTest Support Manager