TestProject Forum

Unable to run tests locally using the Java SDK

I have two Windows machines with the agent installed, each with one iPhone plugged in directly via USB. The devices appear and can be controlled via app.testproject.io, but I keep running into the following error whenever I run a coded test locally:

io.testproject.sdk.internal.exceptions.AgentConnectException: Could not complete the request to start a new session. Another program such as an antivirus/firewall seems to be interfering with the connection.

On machine A, this has been happening from the very beginning, with every version of the agent that has come out since then (2.2.0 to 2.3.1). On machine B, it was working perfectly fine for several days until yesterday when this started happening there too. The only change yesterday was updating the agent from 2.3.0 to 2.3.1.

Running Get-Process -Id (Get-NetTCPConnection -LocalPort 8585).OwningProcess in PowerShell reveals nothing else is using the same port as the agent. I also tried changing the port the agent uses, just in case, with no success.

As a troubleshooting step, I completely uninstalled everything. The agent, my IDE, the Apple tools, everything. I rebooted the computer and the iPhone, and then reinstalled everything. The issue still persists.

In addition, occasionally when I click “Run” on my local tests, the agent will restart itself. I’m not sure if this is related or not, but I thought it worth mentioning.

I’d appreciate any help I can get with this, as I’m kind of at a loss for what to do. I’ve been spinning my wheels on this for two days.

HI @hockiand

Could you please let me know what is the operating system where you run the Agent?
Also, if you could please send your Agent logs to support@testproject.io this could be very helpful.

Hello @marat , I just sent the logs. Both agents are running Windows 10.

Got it, thank you, we will review the logs and get back to you shortly.

1 Like

Hi @hockiand.
I looked at the device logs you sent and it seems there’s a problem with the code signature of the applications on your devices. Uninstalling the application and re-installing it should solve the problem.

I ended up having to remove the apps saved on the TestProject website and re-adding them, then uninstalling and reinstalling the app on the device. Once reinstalled I had to trust the enterprise profile again. Seems to be working now on machine B, thanks!

Unfortunately the iPhone connected to machine A can no longer be interacted with on the website at all. The device preview loads but nothing happens when I click around. So for now I cannot test it on that machine, as it is in a different location to me. I will try it again later and hopefully it will work there too.

Glad to hear everything worked out with machine B!
Let us know how machine A ended up once you can access the device connected to it and uninstall the app :slight_smile:

Just fixed the other machine today, seems to be working well :+1: Looks like that firewall message appears when the developer profile needs to be trusted in Settings > General > Profiles & Device Management.

Thanks for the help :slight_smile:

Glad to hear everything worked out in the end! And thank you for the extra information, it will help us in the future :slight_smile:

1 Like