Cannot execute tests on Firefox

Hi,
I’m trying to run tests on Firefox on a Ubuntu 20.04 machine, but i get the following error

Attention! The Selenium driver that exist in the TestProject Agent folder is missing, or outdated and incompatible with your browser version.
To fix the issue, please make sure that your Agent is registered and that you have an active internet connection.
If you are working OFFLINE or with a non-registered TestProject agent, you can update the Selenium driver manually by replacing it with a new version of the Selenium web driver in the agent’s folder.
You can find more details on how to do so in the following article:https://docs.testproject.io/testproject-agents/unregistered-offline-agent#manual-drivers-update

Checking the agent logs i see the this error:

2022-01-18 14:10:57.433 [INFO ] i.t.a.b.a.d                              GET https://api.testproject.io/dependencies/browser-drivers/Firefox/96.0?os=Linux - 200 (vqCuUh2f): No Message                    
2022-01-18 14:10:57.434 [INFO ] i.t.a.b.b.c                              Received link to download a driver for Firefox browser (96.0)                                                                     
2022-01-18 14:10:57.434 [INFO ] i.t.a.b.b.k                              Downloading driver Firefox browser (96.0)                                                                                         
2022-01-18 14:10:57.671 [INFO ] i.t.a.f.j                                Done killing processes.                                                                                                           
2022-01-18 14:10:57.861 [ERROR] i.t.a.b.b.k                              Failed to save driver for [Firefox browser (96.0)]                                                                                
net.lingala.zip4j.exception.ZipException: Zip headers not found. Probably not a zip file                                                                                                                   
        at net.lingala.zip4j.headers.HeaderReader.locateOffsetOfEndOfCentralDirectoryByReverseSeek(HeaderReader.java:723)                                                                                  
        at net.lingala.zip4j.headers.HeaderReader.locateOffsetOfEndOfCentralDirectory(HeaderReader.java:707)                                                                                               
        at net.lingala.zip4j.headers.HeaderReader.readEndOfCentralDirectoryRecord(HeaderReader.java:110)                                                                                                   
        at net.lingala.zip4j.headers.HeaderReader.readAllHeaders(HeaderReader.java:76)                                                                                                                     
        at net.lingala.zip4j.ZipFile.readZipInfo(ZipFile.java:1124)                                                                                                                                        
        at net.lingala.zip4j.ZipFile.extractAll(ZipFile.java:458)                                                                                                                                          
        at net.lingala.zip4j.ZipFile.extractAll(ZipFile.java:437)                                                                                                                                          
        at io.testproject.agent.a.a.b.c.a(TestProjectAgent:4028)                                                                                                                                           
        at io.testproject.agent.b.b.k.a(TestProjectAgent:1167)                                                                                                                                             
        at io.testproject.agent.managers.q.a(TestProjectAgent:280)                                                                                                                                         
        at io.testproject.agent.managers.q.c(TestProjectAgent:561)                                                                                                                                         
        at io.testproject.agent.managers.q.a(TestProjectAgent:545)                                                                                                                                         
        at io.testproject.agent.managers.worker.b.a(TestProjectAgent:332)                                                                                                                                  
        at io.testproject.agent.managers.worker.b.a(TestProjectAgent:1215)                                                                                                                                 
        at io.testproject.agent.b.c.a.d(TestProjectAgent:355)                                                                                                                                              
        at io.socket.emitter.Emitter.emit(Emitter.java:117)                                                                                                                                                
        at io.socket.client.Socket.onevent(Socket.java:338)                                                                                                                                                
        at io.socket.client.Socket.onpacket(Socket.java:289)                                                                                                                                               
        at io.socket.client.Socket.access$100(Socket.java:24)
        at io.socket.client.Socket$2$2.call(Socket.java:120)
        at io.socket.emitter.Emitter.emit(Emitter.java:117)
        at io.socket.client.Manager.ondecoded(Manager.java:427)
        at io.socket.client.Manager.access$1600(Manager.java:30)
        at io.socket.client.Manager$7.call(Manager.java:403)
        at io.socket.parser.IOParser$Decoder.add(IOParser.java:105)
        at io.socket.client.Manager.ondata(Manager.java:419)
        at io.socket.client.Manager.access$1000(Manager.java:30)
        at io.socket.client.Manager$2.call(Manager.java:370)
        at io.socket.emitter.Emitter.emit(Emitter.java:117)
        at io.socket.engineio.client.Socket.onPacket(Socket.java:551)
        at io.socket.engineio.client.Socket.access$1000(Socket.java:36)
        at io.socket.engineio.client.Socket$5.call(Socket.java:335)
        at io.socket.emitter.Emitter.emit(Emitter.java:117)
        at io.socket.engineio.client.Transport.onPacket(Transport.java:126)
        at io.socket.engineio.client.Transport.onData(Transport.java:118)
        at io.socket.engineio.client.transports.WebSocket.access$100(WebSocket.java:24)
        at io.socket.engineio.client.transports.WebSocket$1$2.run(WebSocket.java:71)
        at io.socket.thread.EventThread$2.run(EventThread.java:80)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:830)

Tried to follow this guide (Unregistered/Offline Agent - TestProject Documentation) about manually downloading the gecko driver, but still doesnt work.

Hi @SjakieMaksym ,

  1. Please try to disable any anti-virus/firewall you have running on your PC.

Common scenarios for communication failures might be:

  • Firewall blocking any external communication with h ttps://testproject.io

  • VPN routing the all traffic to an internal network and not to the internet (outside world).

  • DNS settings are invalid or do not allow resolution of internet addresses.

  • Antivirus or Security software communication.

  1. We need your Agent logs for analysis.

Windows

Open the Start menu, type %appdata%\TestProject\Agent\logs and hit enter.

macOS

Open Files Finder and choose Go from the top menu, select Go to Folder , and type:
~/Library/Application Support/TestProject/Agent

Linux
Navigate to ~/.testproject/agent/logs

Please zip the folder and send it here: support@testproject.io

Hi,

running with Chrome works fine only for Firefox the error appears, there is no antivirus or firewall, the relevant log entry is shown in my previous post

Same problems here. I followed the instructions for offline installation of the geckodriver and I still get the same error. In the start-up logs for the agent, it seems to happily find the correct driver:


Detected Firefox driver [98.0] x64

But then when I run a job, it still insists on downloading a new one, which fails.

@jeromio @SjakieMaksym

When the Agent is not registered and not authenticated, it has several limitations, for example, a version mismatch might occur between the installed browser or the connected device and the bundled driver version.
The best solution in order to resolve this situation is to ensure that:

  • TestProject Agent is registered

  • TestProject Agent can connect to the internet

  • TestProject Agent is not restricted from communicating with the TestProject cloud.

All of those requirements are met.

It seems there are 2 problems:

  1. The manual process of installing the driver does not work. The agent will ignore the already installed driver and attempt to re-install one anyway. This is what happens when the Chrome driver is chosen, it just so happens that the installation for the Chrome driver works as expected and the tests are run. I can see in the traces on the CLI that this is the case.
  2. The auto-install process for Firefox is broken. The code within the agent is attempting to unzip the downloaded file - this is fine for Chrome, since the file is a zip file. But in the case of the firefox geckodriver package, it is a tar.gz archive. When you examine the error, it is clearly using zip4j.ZipFile.extractAll() on the driver package and getting an error since it’s NOT a zipfile.